ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
UserIdsOfPosition.php
Go to the documentation of this file.
1 <?php
2 
4 
6 
12 class UserIdsOfPosition extends Base
13 {
14 
20  protected function run(array $params)
21  {
22  $position_id = $params[self::POSITION_ID];
23 
24  // $record = ilOrgUnitPosition::find($position_id);
25 
26  $usr_ids = [];
27  foreach (ilOrgUnitUserAssignmentQueries::getInstance()->getUserAssignmentsOfPosition($position_id) as $assignment) {
28  $usr_ids[] = $assignment->getUserId();
29  }
30 
31  return $usr_ids;
32  }
33 
34 
38  public function getName()
39  {
40  return "getUserIdsOfPosition";
41  }
42 
43 
47  protected function getAdditionalInputParams()
48  {
49  return array(self::POSITION_ID => Base::TYPE_INT);
50  }
51 
52 
56  public function getOutputParams()
57  {
58  return array(self::USR_IDS => Base::TYPE_INT_ARRAY);
59  }
60 
61 
65  public function getDocumentation()
66  {
67  return "Returns ids of users in a position";
68  }
69 }
getOutputParams()
Get the output parameters in the same format as the input parameters.array
getDocumentation()
Get the documentation of this method.string