ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\OrgUnit\Webservices\SOAP\AddUserIdToPositionInOrgUnit Class Reference

Class AddUserIdToPositionInOrgUnit. More...

+ Inheritance diagram for ILIAS\OrgUnit\Webservices\SOAP\AddUserIdToPositionInOrgUnit:
+ Collaboration diagram for ILIAS\OrgUnit\Webservices\SOAP\AddUserIdToPositionInOrgUnit:

Public Member Functions

 getName ()
 Get the name of the method. More...
 
 getOutputParams ()
 Get the output parameters in the same format as the input parameters. More...
 
 getDocumentation ()
 Get the documentation of this method. More...
 
- Public Member Functions inherited from ILIAS\OrgUnit\Webservices\SOAP\Base
 __construct ()
 
 getServiceStyle ()
 Get the service style, e.g. More...
 
 getServiceUse ()
 Get the service use, e.g. More...
 
 getServiceNamespace ()
 Get the namespace of the service where this method belongs to. More...
 
 getInputParams ()
 Get the input parameters. More...
 
 execute (array $params)
 Execute the business logic for this SOAP method (when a SOAP request hits the endpoint defined by the name). More...
 
 addError (string $message)
 
- Public Member Functions inherited from ilSoapAdministration
 __construct (bool $use_nusoap=true)
 
 getMessage ()
 
 appendMessage (string $a_str)
 
 setMessageCode (string $a_code)
 
 getMessageCode ()
 
 reInitUser ()
 
 isFault ($object)
 
 getInstallationInfoXML ()
 
 getClientInfoXML (string $clientid)
 

Protected Member Functions

 run (array $params)
 
 getAdditionalInputParams ()
 
- Protected Member Functions inherited from ILIAS\OrgUnit\Webservices\SOAP\Base
 initIliasAndCheckSession (string $session_id)
 Use this method at the beginning of your execute() method to check if the provided session ID is valid. More...
 
 checkParameters (array $params)
 Check that all input parameters are present when executing the soap method. More...
 
 getAdditionalInputParams ()
 
 run (array $params)
 
- Protected Member Functions inherited from ilSoapAdministration
 checkSession (string $sid)
 
 explodeSid (string $sid)
 
 setMessage (string $a_str)
 
 initAuth (string $sid)
 
 initIlias ()
 
 initAuthenticationObject ()
 
 raiseError (string $a_message, $a_code)
 
 checkObjectAccess (int $ref_id, array $expected_type, string $permission, bool $returnObject=false)
 check access for ref id: expected type, permission, return object instance if returnobject is true More...
 

Additional Inherited Members

- Data Fields inherited from ILIAS\OrgUnit\Webservices\SOAP\Base
const TYPE_INT_ARRAY = 'tns:intArray'
 
const TYPE_STRING = 'xsd:string'
 
const TYPE_INT = 'xsd:int'
 
const TYPE_DOUBLE_ARRAY = 'tns:doubleArray'
 
const SID = 'sid'
 
const ORGU_REF_ID = 'orgu_ref_id'
 
const POSITION_ID = 'position_id'
 
const USR_IDS = 'usr_ids'
 
const USR_ID = 'usr_id'
 
- Data Fields inherited from ilSoapAdministration
const NUSOAP = 1
 
const PHP5 = 2
 
int $error_method
 Defines type of error handling (PHP5 || NUSOAP) More...
 
- Protected Attributes inherited from ILIAS\OrgUnit\Webservices\SOAP\Base
ilOrgUnitPositionDBRepository $positionRepo
 
ilOrgUnitUserAssignmentDBRepository $assignmentRepo
 
- Protected Attributes inherited from ilSoapAdministration
bool $soap_check = true
 
string $message = ''
 
string $message_code = ''
 

Detailed Description

Member Function Documentation

◆ getAdditionalInputParams()

ILIAS\OrgUnit\Webservices\SOAP\AddUserIdToPositionInOrgUnit::getAdditionalInputParams ( )
protected

Definition at line 55 of file AddUserIdToPositionInOrgUnit.php.

References ILIAS\OrgUnit\Webservices\SOAP\Base\TYPE_INT.

55  : array
56  {
57  return array(self::POSITION_ID => Base::TYPE_INT,
58  self::USR_ID => Base::TYPE_INT,
59  self::ORGU_REF_ID => Base::TYPE_INT
60  );
61  }

◆ getDocumentation()

ILIAS\OrgUnit\Webservices\SOAP\AddUserIdToPositionInOrgUnit::getDocumentation ( )

Get the documentation of this method.

Returns
string

Implements ilSoapMethod.

Definition at line 68 of file AddUserIdToPositionInOrgUnit.php.

68  : string
69  {
70  return "Adds a user to a position in a orgunit";
71  }

◆ getName()

ILIAS\OrgUnit\Webservices\SOAP\AddUserIdToPositionInOrgUnit::getName ( )

Get the name of the method.

Used as endpoint for SOAP requests. Note that this name must be unique in combination with the service namespace.

Returns
string

Implements ilSoapMethod.

Definition at line 50 of file AddUserIdToPositionInOrgUnit.php.

50  : string
51  {
52  return "addUserToPositionInOrgUnit";
53  }

◆ getOutputParams()

ILIAS\OrgUnit\Webservices\SOAP\AddUserIdToPositionInOrgUnit::getOutputParams ( )

Get the output parameters in the same format as the input parameters.

Returns
array

Implements ilSoapMethod.

Definition at line 63 of file AddUserIdToPositionInOrgUnit.php.

63  : array
64  {
65  return [];
66  }

◆ run()

ILIAS\OrgUnit\Webservices\SOAP\AddUserIdToPositionInOrgUnit::run ( array  $params)
protected

Definition at line 31 of file AddUserIdToPositionInOrgUnit.php.

References $user_id, ilObject\_exists(), ilObject\_lookupType(), and ILIAS\OrgUnit\Webservices\SOAP\Base\addError().

31  : bool
32  {
33  $position_id = $params[self::POSITION_ID];
34  $user_id = $params[self::USR_ID];
35  $orgu_ref_id = $params[self::ORGU_REF_ID];
36 
38  $this->addError("User does not exist");
39  } elseif (!$this->positionRepo->getSingle($position_id, 'id') instanceof ilOrgUnitPosition) {
40  $this->addError("Position does not exist");
41  } elseif (ilObject2::_lookupType($orgu_ref_id, true) !== 'orgu') {
42  $this->addError("OrgUnit does not exist");
43  } else {
44  $assignment = $this->assignmentRepo->get($user_id, $position_id, $orgu_ref_id);
45  }
46 
47  return true;
48  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: