ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 
 getAssignmentsOfUserIdAndPosition (int $user_id, int $position_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 235 of file class.ilOrgUnitUserAssignmentQueries.php.

References $DIC.

236  {
237  global $DIC;
238  $q = "DELETE FROM il_orgu_ua WHERE user_id = " . $DIC->database()->quote($user_id, "integer");
239  $DIC->database()->manipulate($q);
240  }
$DIC
Definition: xapitoken.php:46

◆ 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:

◆ getAssignmentsOfUserIdAndPosition()

ilOrgUnitUserAssignmentQueries::getAssignmentsOfUserIdAndPosition ( int  $user_id,
int  $position_id 
)
Parameters
$user_id
Returns
ilOrgUnitUserAssignment[]

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

References ActiveRecord\where().

92  : array
93  {
95  [
96  'user_id' => $user_id,
97  'position_id' => $position_id
98  ]
99  )->get();
100  }
static where($where, $operator=null)
+ Here is the call graph for this function:

◆ getInstance()

◆ getOrgUnitIdsOfUsersPosition()

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

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

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

Referenced by getUserIdsOfOrgUnitsOfUsersPosition(), and getUserIdsOfUsersOrgUnitsInPosition().

184  {
185  $orgu_ids = ilOrgUnitUserAssignment::where([
186  'position_id' => $position_id,
187  'user_id' => $user_id,
188  ])->getArray(null, 'orgu_id');
189 
190  if (!$recursive) {
191  return $orgu_ids;
192  }
193 
194  $recursive_orgu_ids = [];
196  foreach ($orgu_ids as $orgu_id) {
197  $recursive_orgu_ids = $recursive_orgu_ids + $tree->getAllChildren($orgu_id);
198  }
199 
200  return $recursive_orgu_ids;
201  }
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 222 of file class.ilOrgUnitUserAssignmentQueries.php.

References ActiveRecord\where().

223  {
225  'position_id' => $position_id,
226  ])->get();
227  }
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 107 of file class.ilOrgUnitUserAssignmentQueries.php.

References ActiveRecord\where().

108  {
109  return ilOrgUnitUserAssignment::where(['orgu_id' => $orgunit_ref_id])
110  ->getArray(null, 'user_id');
111  }
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 119 of file class.ilOrgUnitUserAssignmentQueries.php.

References ActiveRecord\where().

120  {
121  return ilOrgUnitUserAssignment::where(['orgu_id' => $orgunit_ref_id])
122  ->getArray(null, 'user_id');
123  }
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 148 of file class.ilOrgUnitUserAssignmentQueries.php.

References ActiveRecord\where().

149  {
151  'orgu_id' => $orgu_ids,
152  'position_id' => $position_id,
153  ])->getArray(null, 'user_id');
154  }
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 135 of file class.ilOrgUnitUserAssignmentQueries.php.

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

136  {
137  return ilOrgUnitUserAssignment::where(['orgu_id' => $this->getOrgUnitIdsOfUsersPosition($position_id, $user_id, $recursive)])
138  ->getArray(null, 'user_id');
139  }
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 209 of file class.ilOrgUnitUserAssignmentQueries.php.

References ActiveRecord\where().

210  {
212  'position_id' => $position_id,
213  ])->getArray(null, 'user_id');
214  }
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 166 of file class.ilOrgUnitUserAssignmentQueries.php.

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

167  {
169  'orgu_id' => $this->getOrgUnitIdsOfUsersPosition($users_position_id, $user_id, $recursive),
170  'position_id' => $position_id,
171  ])->getArray(null, 'user_id');
172  }
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: