19 return "il_orgu_positions";
28 public static function get()
60 public function delete()
63 throw new ilException(
'Cannot delete Core-Position');
76 $q =
"SELECT DISTINCT il_orgu_positions.id, il_orgu_positions.*
77 FROM il_orgu_positions
78 LEFT JOIN il_orgu_ua ON il_orgu_positions.id = il_orgu_ua.position_id
79 WHERE il_orgu_ua.user_id IS NOT NULL
80 OR il_orgu_positions.core_position = 1";
81 $database =
$GLOBALS[
'DIC']->database();
82 $st = $database->query($q);
86 while (
$data = $database->fetchAssoc($st)) {
87 $position =
new self();
88 $position->buildFromArray(
$data);
89 $positions[] = $position;
105 $q =
"SELECT DISTINCT il_orgu_positions.id, il_orgu_positions.*
106 FROM il_orgu_positions
107 LEFT JOIN il_orgu_ua ON il_orgu_positions.id = il_orgu_ua.position_id AND il_orgu_ua.orgu_id = %s
108 WHERE il_orgu_ua.user_id IS NOT NULL
109 OR core_position = 1";
110 $database =
$GLOBALS[
'DIC']->database();
111 $st = $database->queryF($q, array(
'integer' ), array( $orgu_ref_id ));
113 $positions = array();
115 while (
$data = $database->fetchAssoc($st)) {
116 $position =
new self();
117 $position->buildFromArray(
$data);
118 $positions[] = $position;
242 foreach ($ilOrgUnitUserAssignmentQueries->getUserAssignmentsOfPosition($this->getId()) as $assignment) {
243 $assignment->delete();
362 if ($authority->getId()) {
369 if (
count($ids) > 0) {
372 'position_id' => $this->
getId(),
373 ), array(
'id' =>
'NOT IN',
'position_id' =>
'=' ))->
get() as
$authority) {
378 if (
count($ids) === 0) {
380 'position_id' => $this->
getId(),
static where($where, $operator=null)
An exception for terminatinating execution or to throw for unit testing.
static flush($class_name)
Base class for ILIAS Exception handling.
setCoreIdentifier($core_identifier)
setAuthorities($authorities)
static getActiveForPosition($orgu_ref_id)
getDependentAuthorities()
static getCorePosition($core_identifier)
const CORE_POSITION_EMPLOYEE
deleteWithAllDependencies()
This deletes the Position, it's Authorities, dependent Authorities and all User-Assignements!
static getCorePositionId($core_identifier)
setCorePosition($core_position)
setDescription($description)
const CORE_POSITION_SUPERIOR
static returnDbTableName()
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
update($pash, $contents, Config $config)