ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
UserIdsOfPosition.php
Go to the documentation of this file.
1 <?php
20 
22 
27 class UserIdsOfPosition extends Base
28 {
32  protected function run(array $params): array
33  {
34  $position_id = $params[self::POSITION_ID];
35 
36  // $record = ilOrgUnitPosition::find($position_id);
37 
38  $usr_ids = [];
39  foreach (ilOrgUnitUserAssignmentQueries::getInstance()->getUserAssignmentsOfPosition($position_id) as $assignment) {
40  $usr_ids[] = $assignment->getUserId();
41  }
42 
43  return $usr_ids;
44  }
45 
46  public function getName(): string
47  {
48  return "getUserIdsOfPosition";
49  }
50 
51  protected function getAdditionalInputParams(): array
52  {
53  return array(self::POSITION_ID => Base::TYPE_INT);
54  }
55 
56  public function getOutputParams(): array
57  {
58  return array(self::USR_IDS => Base::TYPE_INT_ARRAY);
59  }
60 
61  public function getDocumentation(): string
62  {
63  return "Returns ids of users in a position";
64  }
65 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
getOutputParams()
Get the output parameters in the same format as the input parameters.
getDocumentation()
Get the documentation of this method.