ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilOrgUnitPermission Class Reference

Class ilOrgUnitPermissionGUI. More...

+ Inheritance diagram for ilOrgUnitPermission:
+ Collaboration diagram for ilOrgUnitPermission:

Public Member Functions

 update ()
 
 create ()
 
 delete ()
 
 afterObjectLoad ()
 
 getId ()
 
 setId ($id)
 
 getContextId ()
 
 setContextId ($context_id)
 
 getOperations ()
 
 setOperations ($operations)
 
 getParentId ()
 
 setParentId ($parent_id)
 
 getPossibleOperations ()
 
 getSelectedOperationIds ()
 
 isOperationIdSelected ($operation_id)
 
 getContext ()
 
 setContext ($context)
 
 getPositionId ()
 
 setPositionId ($position_id)
 
 isTemplate ()
 
 isDedicated ()
 
 isProtected ()
 
 setProtected ($protected)
 
 isNewlyCreated ()
 
 setNewlyCreated ($newly_created)
 
 sleep ($field_name)
 
 wakeUp ($field_name, $field_value)
 
- Public Member Functions inherited from ActiveRecord
 getArConnector ()
 
 getArFieldList ()
 
 getConnectorContainerName ()
 
 setConnectorContainerName ($connector_container_name)
 
 getPrimaryFieldValue ()
 
 setPrimaryFieldValue ($value)
 
 __construct ($primary_key=0, arConnector $connector=null)
 
 storeObjectToCache ()
 
 __getConvertedDateFieldsAsArray ($format=null)
 
 __asCsv ($separator=';', $header=false)
 
 __asArray ()
 
 __asStdClass ()
 
 __asSerializedObject ()
 
 buildFromArray (array $array)
 
 fixDateField ($field_name, $value)
 
 sleep ($field_name)
 
 wakeUp ($field_name, $field_value)
 
 getArrayForDb ()
 
 getArrayForConnector ()
 
 installConnector ()
 
 store ()
 
 save ()
 
 create ()
 
 copy ($new_id=0)
 
 afterObjectLoad ()
 
 read ()
 
 update ()
 
 delete ()
 
 __call ($name, $arguments)
 

Static Public Member Functions

static returnDbTableName ()
 
- Static Public Member Functions inherited from ActiveRecord
static returnDbTableName ()
 
static installDB ()
 
static renameDBField ($old_name, $new_name)
 
static tableExists ()
 
static fieldExists ($field_name)
 
static removeDBField ($field_name)
 
static updateDB ()
 
static resetDB ()
 
static truncateDB ()
 
static flushDB ()
 
static preloadObjects ()
 
static additionalParams (array $additional_params)
 
static findOrFail ($primary_key, array $add_constructor_args=array())
 Tries to find the object and throws an Exception if object is not found, instead of returning null. More...
 
static findOrGetInstance ($primary_key, array $add_constructor_args=array())
 
static where ($where, $operator=null)
 
static innerjoinAR (ActiveRecord $ar, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
 
static innerjoin ($tablename, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
 
static leftjoin ($tablename, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
 
static orderBy ($orderBy, $orderDirection='ASC')
 
static dateFormat ($date_format='d.m.Y - H:i:s')
 
static limit ($start, $end)
 
static affectedRows ()
 
static count ()
 
static get ()
 
static debug ()
 
static first ()
 
static getCollection ()
 
static last ()
 
static getFirstFromLastQuery ()
 
static connector (arConnector $connector)
 
static raw ($set_raw=true)
 
static getArray ($key=null, $values=null)
 
static _toCamelCase ($str, $capitalise_first_char=false)
 

Data Fields

const PARENT_TEMPLATE = -1
 
const TABLE_NAME = 'il_orgu_permissions'
 
- Data Fields inherited from ActiveRecord
const ACTIVE_RECORD_VERSION = '2.0.7'
 

Protected Attributes

 $id = 0
 
 $context_id = 0
 
 $operations = []
 
 $possible_operations = []
 
 $selected_operation_ids = []
 
 $parent_id = self::PARENT_TEMPLATE
 
 $position_id = 0
 
 $context
 
 $protected = false
 
 $newly_created = false
 
- Protected Attributes inherited from ActiveRecord
 $ar_safe_read = true
 
 $connector_container_name = ''
 

Additional Inherited Members

- Protected Member Functions inherited from ActiveRecord
 serializeToCSV ($field)
 This method is called for every field of your instance if you use __asCsv. More...
 
 installDatabase ()
 
- Static Protected Member Functions inherited from ActiveRecord
static getCalledClass ()
 
static fromCamelCase ($str)
 

Detailed Description

Member Function Documentation

◆ afterObjectLoad()

ilOrgUnitPermission::afterObjectLoad ( )

Definition at line 108 of file class.ilOrgUnitPermission.php.

References ilOrgUnitOperationContextQueries\findById(), and getContextId().

109  {
110  $this->possible_operations = ilOrgUnitOperationQueries::getOperationsForContextId($this->getContextId());
111  $this->operations = is_array($this->operations) ? $this->operations : array();
112  foreach ($this->operations as $operation) {
113  $this->selected_operation_ids[] = $operation->getOperationId();
114  }
115  $this->context = ilOrgUnitOperationContextQueries::findById($this->getContextId());
116  }
+ Here is the call graph for this function:

◆ create()

ilOrgUnitPermission::create ( )

Definition at line 90 of file class.ilOrgUnitPermission.php.

References isProtected().

91  {
92  if ($this->isProtected()) {
93  throw new ilException('Cannot modify a protected ilOrgUnitPermission');
94  }
95  parent::create();
96  }
+ Here is the call graph for this function:

◆ delete()

ilOrgUnitPermission::delete ( )

Definition at line 99 of file class.ilOrgUnitPermission.php.

References isProtected().

100  {
101  if ($this->isProtected()) {
102  throw new ilException('Cannot modify a protected ilOrgUnitPermission');
103  }
104  parent::delete();
105  }
+ Here is the call graph for this function:

◆ getContext()

ilOrgUnitPermission::getContext ( )
Returns

Definition at line 223 of file class.ilOrgUnitPermission.php.

References $context.

Referenced by ilOrgUnitDefaultPermissionTableGUI\__construct().

224  {
225  return $this->context;
226  }
+ Here is the caller graph for this function:

◆ getContextId()

ilOrgUnitPermission::getContextId ( )
Returns
int

Definition at line 140 of file class.ilOrgUnitPermission.php.

References $context_id.

Referenced by afterObjectLoad().

141  {
142  return $this->context_id;
143  }
+ Here is the caller graph for this function:

◆ getId()

ilOrgUnitPermission::getId ( )
Returns
int

Definition at line 122 of file class.ilOrgUnitPermission.php.

References $id.

Referenced by ilOrgUnitDefaultPermissionTableGUI\__construct().

123  {
124  return $this->id;
125  }
+ Here is the caller graph for this function:

◆ getOperations()

ilOrgUnitPermission::getOperations ( )
Returns
[]

Definition at line 158 of file class.ilOrgUnitPermission.php.

References $operations.

159  {
160  return $this->operations;
161  }

◆ getParentId()

ilOrgUnitPermission::getParentId ( )
Returns
int

Definition at line 176 of file class.ilOrgUnitPermission.php.

References $parent_id.

Referenced by isDedicated(), and isTemplate().

177  {
178  return $this->parent_id;
179  }
+ Here is the caller graph for this function:

◆ getPositionId()

ilOrgUnitPermission::getPositionId ( )
Returns
int

Definition at line 250 of file class.ilOrgUnitPermission.php.

References $position_id.

251  {
252  return $this->position_id;
253  }

◆ getPossibleOperations()

ilOrgUnitPermission::getPossibleOperations ( )
Returns
[]

Definition at line 194 of file class.ilOrgUnitPermission.php.

References $possible_operations.

Referenced by ilOrgUnitDefaultPermissionTableGUI\__construct().

+ Here is the caller graph for this function:

◆ getSelectedOperationIds()

ilOrgUnitPermission::getSelectedOperationIds ( )
Returns
int[]

Definition at line 203 of file class.ilOrgUnitPermission.php.

References $selected_operation_ids.

◆ isDedicated()

ilOrgUnitPermission::isDedicated ( )
Returns
bool

Definition at line 277 of file class.ilOrgUnitPermission.php.

References getParentId().

278  {
279  return ($this->getParentId() != self::PARENT_TEMPLATE);
280  }
+ Here is the call graph for this function:

◆ isNewlyCreated()

ilOrgUnitPermission::isNewlyCreated ( )
Returns
bool

Definition at line 304 of file class.ilOrgUnitPermission.php.

References $newly_created.

305  {
306  return $this->newly_created;
307  }

◆ isOperationIdSelected()

ilOrgUnitPermission::isOperationIdSelected (   $operation_id)
Parameters
$operation_id
Returns
bool

Definition at line 214 of file class.ilOrgUnitPermission.php.

Referenced by ilOrgUnitDefaultPermissionTableGUI\fillRow().

215  {
216  return in_array($operation_id, $this->selected_operation_ids);
217  }
+ Here is the caller graph for this function:

◆ isProtected()

ilOrgUnitPermission::isProtected ( )
Returns
bool

Definition at line 286 of file class.ilOrgUnitPermission.php.

References $protected.

Referenced by create(), delete(), and update().

287  {
288  return $this->protected;
289  }
+ Here is the caller graph for this function:

◆ isTemplate()

ilOrgUnitPermission::isTemplate ( )
Returns
bool

Definition at line 268 of file class.ilOrgUnitPermission.php.

References getParentId().

269  {
270  return ($this->getParentId() == self::PARENT_TEMPLATE);
271  }
+ Here is the call graph for this function:

◆ returnDbTableName()

static ilOrgUnitPermission::returnDbTableName ( )
static
Returns
string

Definition at line 241 of file class.ilOrgUnitPermission.php.

242  {
243  return self::TABLE_NAME;
244  }

◆ setContext()

ilOrgUnitPermission::setContext (   $context)
Parameters
\ilOrgUnitOperationContext$context

Definition at line 232 of file class.ilOrgUnitPermission.php.

References $context.

233  {
234  $this->context = $context;
235  }

◆ setContextId()

ilOrgUnitPermission::setContextId (   $context_id)
Parameters
int$context_id

Definition at line 149 of file class.ilOrgUnitPermission.php.

References $context_id.

150  {
151  $this->context_id = $context_id;
152  }

◆ setId()

ilOrgUnitPermission::setId (   $id)
Parameters
int$id

Definition at line 131 of file class.ilOrgUnitPermission.php.

References $id.

132  {
133  $this->id = $id;
134  }

◆ setNewlyCreated()

ilOrgUnitPermission::setNewlyCreated (   $newly_created)
Parameters
bool$newly_created

Definition at line 313 of file class.ilOrgUnitPermission.php.

References $newly_created.

314  {
315  $this->newly_created = $newly_created;
316  }

◆ setOperations()

ilOrgUnitPermission::setOperations (   $operations)
Parameters

Definition at line 167 of file class.ilOrgUnitPermission.php.

References $operations.

168  {
169  $this->operations = $operations;
170  }

◆ setParentId()

ilOrgUnitPermission::setParentId (   $parent_id)
Parameters
int$parent_id

Definition at line 185 of file class.ilOrgUnitPermission.php.

References $parent_id.

186  {
187  $this->parent_id = $parent_id;
188  }

◆ setPositionId()

ilOrgUnitPermission::setPositionId (   $position_id)
Parameters
int$position_id

Definition at line 259 of file class.ilOrgUnitPermission.php.

References $position_id.

260  {
261  $this->position_id = $position_id;
262  }

◆ setProtected()

ilOrgUnitPermission::setProtected (   $protected)
Parameters
bool$protected

Definition at line 295 of file class.ilOrgUnitPermission.php.

References $protected.

296  {
297  $this->protected = $protected;
298  }

◆ sleep()

ilOrgUnitPermission::sleep (   $field_name)
Parameters
$field_name
Returns
mixed|string

Definition at line 324 of file class.ilOrgUnitPermission.php.

325  {
326  switch ($field_name) {
327  case 'operations':
328  $ids = [];
329  foreach ($this->operations as $operation) {
330  $ids[] = $operation->getOperationId();
331  }
332 
333  return json_encode($ids);
334  }
335 
336  return parent::sleep($field_name);
337  }

◆ update()

ilOrgUnitPermission::update ( )

Definition at line 81 of file class.ilOrgUnitPermission.php.

References isProtected(), and League\Flysystem\Adapter\Polyfill\update().

82  {
83  if ($this->isProtected()) {
84  throw new ilException('Cannot modify a protected ilOrgUnitPermission');
85  }
87  }
update($pash, $contents, Config $config)
+ Here is the call graph for this function:

◆ wakeUp()

ilOrgUnitPermission::wakeUp (   $field_name,
  $field_value 
)
Parameters
$field_name
$field_value
Returns
mixed

Definition at line 346 of file class.ilOrgUnitPermission.php.

References $id, $operations, and ilOrgUnitOperationQueries\findById().

347  {
348  switch ($field_name) {
349  case 'operations':
350  $ids = json_decode($field_value);
351  $ids = is_array($ids) ? $ids : array();
352  $operations = [];
353  foreach ($ids as $id) {
354  $ilOrgUnitOperation = ilOrgUnitOperationQueries::findById($id);
355  if ($ilOrgUnitOperation) {
356  $operations[] = $ilOrgUnitOperation;
357  }
358  }
359 
360  return $operations;
361  }
362 
363  return parent::wakeUp($field_name, $field_value);
364  }
+ Here is the call graph for this function:

Field Documentation

◆ $context

ilOrgUnitPermission::$context
protected

Definition at line 66 of file class.ilOrgUnitPermission.php.

Referenced by getContext(), and setContext().

◆ $context_id

ilOrgUnitPermission::$context_id = 0
protected

Definition at line 30 of file class.ilOrgUnitPermission.php.

Referenced by getContextId(), and setContextId().

◆ $id

ilOrgUnitPermission::$id = 0
protected

Definition at line 22 of file class.ilOrgUnitPermission.php.

Referenced by getId(), setId(), and wakeUp().

◆ $newly_created

ilOrgUnitPermission::$newly_created = false
protected

Definition at line 78 of file class.ilOrgUnitPermission.php.

Referenced by isNewlyCreated(), and setNewlyCreated().

◆ $operations

ilOrgUnitPermission::$operations = []
protected

Definition at line 38 of file class.ilOrgUnitPermission.php.

Referenced by getOperations(), setOperations(), and wakeUp().

◆ $parent_id

ilOrgUnitPermission::$parent_id = self::PARENT_TEMPLATE
protected

Definition at line 54 of file class.ilOrgUnitPermission.php.

Referenced by getParentId(), and setParentId().

◆ $position_id

ilOrgUnitPermission::$position_id = 0
protected

Definition at line 62 of file class.ilOrgUnitPermission.php.

Referenced by getPositionId(), and setPositionId().

◆ $possible_operations

ilOrgUnitPermission::$possible_operations = []
protected

Definition at line 42 of file class.ilOrgUnitPermission.php.

Referenced by getPossibleOperations().

◆ $protected

ilOrgUnitPermission::$protected = false
protected

Definition at line 74 of file class.ilOrgUnitPermission.php.

Referenced by isProtected(), and setProtected().

◆ $selected_operation_ids

ilOrgUnitPermission::$selected_operation_ids = []
protected

Definition at line 46 of file class.ilOrgUnitPermission.php.

Referenced by getSelectedOperationIds().

◆ PARENT_TEMPLATE

const ilOrgUnitPermission::PARENT_TEMPLATE = -1

◆ TABLE_NAME

const ilOrgUnitPermission::TABLE_NAME = 'il_orgu_permissions'

Definition at line 11 of file class.ilOrgUnitPermission.php.


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