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

Class AddUserIdToPositionInOrgUnit. More...

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

Public Member Functions

 getName ()
 
 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\RemoveUserIdFromPositionInOrgUnit::getAdditionalInputParams ( )
protected

Definition at line 70 of file RemoveUserIdFromPositionInOrgUnit.php.

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

70  : array
71  {
72  return array(self::POSITION_ID => Base::TYPE_INT,
73  self::USR_ID => Base::TYPE_INT,
74  self::ORGU_REF_ID => Base::TYPE_INT
75  );
76  }

◆ getDocumentation()

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

Get the documentation of this method.

Returns
string

Implements ilSoapMethod.

Definition at line 83 of file RemoveUserIdFromPositionInOrgUnit.php.

83  : string
84  {
85  return "Removes a user from a position in a orgunit";
86  }

◆ getName()

ILIAS\OrgUnit\Webservices\SOAP\RemoveUserIdFromPositionInOrgUnit::getName ( )
Returns
string

Implements ilSoapMethod.

Definition at line 65 of file RemoveUserIdFromPositionInOrgUnit.php.

65  : string
66  {
67  return "removeUserFromPositionInOrgUnit";
68  }

◆ getOutputParams()

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

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

Returns
array

Implements ilSoapMethod.

Definition at line 78 of file RemoveUserIdFromPositionInOrgUnit.php.

78  : array
79  {
80  return [];
81  }

◆ run()

ILIAS\OrgUnit\Webservices\SOAP\RemoveUserIdFromPositionInOrgUnit::run ( array  $params)
protected
Exceptions
SoapFault

Definition at line 36 of file RemoveUserIdFromPositionInOrgUnit.php.

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

36  : bool
37  {
38  $position_id = $params[self::POSITION_ID];
39  $user_id = $params[self::USR_ID];
40  $orgu_ref_id = $params[self::ORGU_REF_ID];
41 
43  throw new LogicException("User does not exist");
44  }
45  if (!$this->positionRepo->getSingle($position_id, 'id') instanceof ilOrgUnitPosition) {
46  throw new LogicException("Position does not exist");
47  }
48  if (ilObject2::_lookupType($orgu_ref_id, true) !== 'orgu') {
49  throw new LogicException("OrgUnit does not exist");
50  } else {
51  $assignment = $this->assignmentRepo->find($user_id, $position_id, $orgu_ref_id);
52  if ($assignment) {
53  $this->assignmentRepo->delete($assignment);
54  } else {
55  $this->addError("No assignment found");
56  }
57  }
58 
59  return true;
60  }
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: