ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilOrgUnitUserAssignmentQueries Class Reference

Class ilOrgUnitUserAssignmentQueries. More...

+ Collaboration diagram for ilOrgUnitUserAssignmentQueries:

Public Member Functions

 getAssignmentOrFail ($user_id, $position_id, $orgu_id)
 
 filterUserIdsDueToAuthorities ($user_id, array $user_ids)
 
 getAssignmentsOfUserId ($user_id)
 
 getUserIdsOfOrgUnit ($orgunit_ref_id)
 
 getUserIdsOfOrgUnits (array $orgunit_ref_id)
 
 getUserIdsOfOrgUnitsOfUsersPosition ($position_id, $user_id, $recursive=false)
 
 getUserIdsOfOrgUnitsInPosition (array $orgu_ids, $position_id)
 
 getUserIdsOfUsersOrgUnitsInPosition ($user_id, $users_position_id, $position_id, $recursive=false)
 
 getOrgUnitIdsOfUsersPosition ($position_id, $user_id, $recursive=false)
 
 getUserIdsOfPosition ($position_id)
 
 getUserAssignmentsOfPosition ($position_id)
 
 deleteAllAssignmentsOfUser ($user_id)
 

Static Public Member Functions

static getInstance ()
 

Static Protected Attributes

static $instance
 

Detailed Description

Member Function Documentation

◆ deleteAllAssignmentsOfUser()

ilOrgUnitUserAssignmentQueries::deleteAllAssignmentsOfUser (   $user_id)
Parameters
int$user_id
Returns
void

Definition at line 220 of file class.ilOrgUnitUserAssignmentQueries.php.

References $DIC.

221  {
222  global $DIC;
223  $q = "DELETE FROM il_orgu_ua WHERE user_id = " . $DIC->database()->quote($user_id, "integer");
224  $DIC->database()->manipulate($q);
225  }
global $DIC
Definition: saml.php:7

◆ filterUserIdsDueToAuthorities()

ilOrgUnitUserAssignmentQueries::filterUserIdsDueToAuthorities (   $user_id,
array  $user_ids 
)

Definition at line 72 of file class.ilOrgUnitUserAssignmentQueries.php.

73  {
74  }

◆ getAssignmentOrFail()

ilOrgUnitUserAssignmentQueries::getAssignmentOrFail (   $user_id,
  $position_id,
  $orgu_id 
)
Parameters
int$user_id
int$position_id
int$orgu_idOrg-Units Ref-ID
Returns
Exceptions

Definition at line 57 of file class.ilOrgUnitUserAssignmentQueries.php.

References ActiveRecord\where().

58  {
60  'user_id' => $user_id,
61  'position_id' => $position_id,
62  'orgu_id' => $orgu_id,
63  ])->first();
64  if (!$ua) {
65  throw new ilException('UserAssignement not found');
66  }
67 
68  return $ua;
69  }
static where($where, $operator=null)
+ Here is the call graph for this function:

◆ getAssignmentsOfUserId()

ilOrgUnitUserAssignmentQueries::getAssignmentsOfUserId (   $user_id)
Parameters
$user_id
Returns
ilOrgUnitUserAssignment[]

Definition at line 82 of file class.ilOrgUnitUserAssignmentQueries.php.

References ActiveRecord\where().

Referenced by getInstance().

83  {
84  return ilOrgUnitUserAssignment::where([ 'user_id' => $user_id ])->get();
85  }
static where($where, $operator=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInstance()

static ilOrgUnitUserAssignmentQueries::getInstance ( )
static
Returns

Definition at line 20 of file class.ilOrgUnitUserAssignmentQueries.php.

References getAssignmentsOfUserId().

Referenced by ilOrgUnitPositionAccess\__construct(), ilOrgUnitPositionGUI\assign(), ilOrgUnitPositionGUI\confirmDeletion(), ilOrgUnitUserAssignmentGUI\delete(), ilObjUser\delete(), and ilOrgUnitPosition\deleteWithAllDependencies().

21  {
22  if (!isset(self::$instance)) {
23  self::$instance = new self();
24  }
25 
26  return self::$instance;
27  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOrgUnitIdsOfUsersPosition()

ilOrgUnitUserAssignmentQueries::getOrgUnitIdsOfUsersPosition (   $position_id,
  $user_id,
  $recursive = false 
)
Parameters
$position_id
$user_id
bool$recursive
Returns
int[]

Definition at line 169 of file class.ilOrgUnitUserAssignmentQueries.php.

References ilObjOrgUnitTree\_getInstance(), and ActiveRecord\where().

Referenced by getUserIdsOfOrgUnitsOfUsersPosition(), and getUserIdsOfUsersOrgUnitsInPosition().

170  {
171  $orgu_ids = ilOrgUnitUserAssignment::where([
172  'position_id' => $position_id,
173  'user_id' => $user_id,
174  ])->getArray(null, 'orgu_id');
175 
176  if (!$recursive) {
177  return $orgu_ids;
178  }
179 
180  $recursive_orgu_ids = [];
182  foreach ($orgu_ids as $orgu_id) {
183  $recursive_orgu_ids = $recursive_orgu_ids + $tree->getAllChildren($orgu_id);
184  }
185 
186  return $recursive_orgu_ids;
187  }
static where($where, $operator=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUserAssignmentsOfPosition()

ilOrgUnitUserAssignmentQueries::getUserAssignmentsOfPosition (   $position_id)
Parameters
$position_id
Returns
ilOrgUnitUserAssignment[]

Definition at line 208 of file class.ilOrgUnitUserAssignmentQueries.php.

References ActiveRecord\where().

209  {
211  'position_id' => $position_id,
212  ])->get();
213  }
static where($where, $operator=null)
+ Here is the call graph for this function:

◆ getUserIdsOfOrgUnit()

ilOrgUnitUserAssignmentQueries::getUserIdsOfOrgUnit (   $orgunit_ref_id)
Parameters
$orgunit_ref_id
Returns
ilOrgUnitUserAssignment[]

Definition at line 93 of file class.ilOrgUnitUserAssignmentQueries.php.

References ActiveRecord\where().

94  {
95  return ilOrgUnitUserAssignment::where([ 'orgu_id' => $orgunit_ref_id ])
96  ->getArray(null, 'user_id');
97  }
static where($where, $operator=null)
+ Here is the call graph for this function:

◆ getUserIdsOfOrgUnits()

ilOrgUnitUserAssignmentQueries::getUserIdsOfOrgUnits ( array  $orgunit_ref_id)
Parameters
$orgunit_ref_id
Returns
ilOrgUnitUserAssignment[]

Definition at line 105 of file class.ilOrgUnitUserAssignmentQueries.php.

References ActiveRecord\where().

106  {
107  return ilOrgUnitUserAssignment::where([ 'orgu_id' => $orgunit_ref_id ])
108  ->getArray(null, 'user_id');
109  }
static where($where, $operator=null)
+ Here is the call graph for this function:

◆ getUserIdsOfOrgUnitsInPosition()

ilOrgUnitUserAssignmentQueries::getUserIdsOfOrgUnitsInPosition ( array  $orgu_ids,
  $position_id 
)
Parameters
array$orgu_ids
$position_id
Returns
int[]

Definition at line 134 of file class.ilOrgUnitUserAssignmentQueries.php.

References ActiveRecord\where().

135  {
137  'orgu_id' => $orgu_ids,
138  'position_id' => $position_id,
139  ])->getArray(null, 'user_id');
140  }
static where($where, $operator=null)
+ Here is the call graph for this function:

◆ getUserIdsOfOrgUnitsOfUsersPosition()

ilOrgUnitUserAssignmentQueries::getUserIdsOfOrgUnitsOfUsersPosition (   $position_id,
  $user_id,
  $recursive = false 
)
Parameters
$position_id
$user_id
bool$recursive
Returns
[]

Definition at line 121 of file class.ilOrgUnitUserAssignmentQueries.php.

References getOrgUnitIdsOfUsersPosition(), and ActiveRecord\where().

122  {
123  return ilOrgUnitUserAssignment::where([ 'orgu_id' => $this->getOrgUnitIdsOfUsersPosition($position_id, $user_id, $recursive) ])
124  ->getArray(null, 'user_id');
125  }
static where($where, $operator=null)
getOrgUnitIdsOfUsersPosition($position_id, $user_id, $recursive=false)
+ Here is the call graph for this function:

◆ getUserIdsOfPosition()

ilOrgUnitUserAssignmentQueries::getUserIdsOfPosition (   $position_id)
Parameters
$position_id
Returns
int[]

Definition at line 195 of file class.ilOrgUnitUserAssignmentQueries.php.

References ActiveRecord\where().

196  {
198  'position_id' => $position_id,
199  ])->getArray(null, 'user_id');
200  }
static where($where, $operator=null)
+ Here is the call graph for this function:

◆ getUserIdsOfUsersOrgUnitsInPosition()

ilOrgUnitUserAssignmentQueries::getUserIdsOfUsersOrgUnitsInPosition (   $user_id,
  $users_position_id,
  $position_id,
  $recursive = false 
)
Parameters
$user_id
$users_position_id
$position_id
bool$recursive
Returns
int[]

Definition at line 152 of file class.ilOrgUnitUserAssignmentQueries.php.

References getOrgUnitIdsOfUsersPosition(), and ActiveRecord\where().

153  {
155  'orgu_id' => $this->getOrgUnitIdsOfUsersPosition($users_position_id, $user_id, $recursive),
156  'position_id' => $position_id,
157  ])->getArray(null, 'user_id');
158  }
static where($where, $operator=null)
getOrgUnitIdsOfUsersPosition($position_id, $user_id, $recursive=false)
+ Here is the call graph for this function:

Field Documentation

◆ $instance

ilOrgUnitUserAssignmentQueries::$instance
staticprotected

Definition at line 14 of file class.ilOrgUnitUserAssignmentQueries.php.


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