ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilOrgUnitPermission Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 __construct ($primary_key=0)
 
 update ()
 
 create ()
 
 delete ()
 
 afterObjectLoad ()
 
 getId ()
 
 setId (?int $id)
 
 getContextId ()
 
 setContextId (int $context_id)
 
 getOperations ()
 
 setOperations (array $operations)
 
 getParentId ()
 
 setParentId (int $parent_id)
 
 getPossibleOperations ()
 
 getSelectedOperationIds ()
 
 isOperationIdSelected (int $operation_id)
 
 getContext ()
 
 setContext (ilOrgUnitOperationContext $context)
 
 getPositionId ()
 
 setPositionId (int $position_id)
 
 isTemplate ()
 
 isDedicated ()
 
 isProtected ()
 
 setProtected (bool $protected)
 
 isNewlyCreated ()
 
 setNewlyCreated (bool $newly_created)
 
 sleep ($field_name)
 
 wakeUp ($field_name, $field_value)
 
- Public Member Functions inherited from ActiveRecord
 getArConnector ()
 
 getArFieldList ()
 
 getConnectorContainerName ()
 Return the Name of your Connector Table More...
 
 setConnectorContainerName (string $connector_container_name)
 
 getPrimaryFieldValue ()
 
 setPrimaryFieldValue ($value)
 
 __construct ($primary_key=0)
 
 storeObjectToCache ()
 
 asStdClass ()
 
 buildFromArray (array $array)
 
 fixDateField ($field_name, $value)
 
 sleep ($field_name)
 
 wakeUp ($field_name, $field_value)
 
 getArrayForConnector ()
 
 installConnector ()
 
 store ()
 
 save ()
 
 create ()
 
 copy (int $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 (string $old_name, string $new_name)
 
static tableExists ()
 
static fieldExists (string $field_name)
 
static removeDBField (string $field_name)
 
static updateDB ()
 
static resetDB ()
 
static truncateDB ()
 
static flushDB ()
 never use in ILIAS Core, Plugins only More...
 
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, array $fields=array(' *'), string $operator='=', $both_external=false)
 
static innerjoin ( $tablename, $on_this, $on_external, array $fields=array(' *'), string $operator='=', bool $both_external=false)
 
static leftjoin ( $tablename, $on_this, $on_external, array $fields=array(' *'), string $operator='=', bool $both_external=false)
 
static orderBy ($orderBy, string $orderDirection='ASC')
 
static dateFormat (string $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 (bool $set_raw=true)
 
static getArray (?string $key=null, $values=null)
 
static _toCamelCase (string $str, bool $capitalise_first_char=false)
 

Data Fields

const PARENT_TEMPLATE = -1
 
const TABLE_NAME = 'il_orgu_permissions'
 

Protected Attributes

int $id = 0
 
int $context_id = 0
 
array $operations = []
 
array $possible_operations = []
 
array $selected_operation_ids = []
 
int $parent_id = self::PARENT_TEMPLATE
 
int $position_id = 0
 
ilOrgUnitOperationContext $context = null
 
bool $protected = false
 true integer 1 More...
 
bool $newly_created = false
 
- Protected Attributes inherited from ActiveRecord
bool $ar_safe_read = true
 
string $connector_container_name = ''
 
bool $is_new = true
 

Additional Inherited Members

- Protected Member Functions inherited from ActiveRecord
 installDatabase ()
 
- Static Protected Member Functions inherited from ActiveRecord
static getCalledClass ()
 Returns an instance of the instatiated calling active record (needs to be done in static methods) : This should be cached somehow More...
 
static fromCamelCase (string $str)
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilOrgUnitPermissionGUI

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

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

Constructor & Destructor Documentation

◆ __construct()

ilOrgUnitPermission::__construct (   $primary_key = 0)

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

References ILIAS\GlobalScreen\Provider\__construct(), and afterObjectLoad().

83  {
84  parent::__construct($primary_key);
85  $this->afterObjectLoad();
86  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ afterObjectLoad()

ilOrgUnitPermission::afterObjectLoad ( )

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

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

Referenced by __construct().

112  : void
113  {
114  $this->possible_operations = ilOrgUnitOperationQueries::getOperationsForContextId($this->getContextId());
115  $this->operations = is_array($this->operations) ? $this->operations : array();
116  foreach ($this->operations as $operation) {
117  $this->selected_operation_ids[] = $operation->getOperationId();
118  }
119  $this->context = ilOrgUnitOperationContextQueries::findById($this->getContextId());
120  }
static getOperationsForContextId(string $context_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilOrgUnitPermission::create ( )

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

References isProtected().

96  : void
97  {
98  if ($this->isProtected()) {
99  throw new ilException('Cannot modify a protected ilOrgUnitPermission');
100  }
101  parent::create();
102  }
+ Here is the call graph for this function:

◆ delete()

ilOrgUnitPermission::delete ( )

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

References isProtected().

104  : void
105  {
106  if ($this->isProtected()) {
107  throw new ilException('Cannot modify a protected ilOrgUnitPermission');
108  }
109  parent::delete();
110  }
+ Here is the call graph for this function:

◆ getContext()

ilOrgUnitPermission::getContext ( )

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

References $context.

Referenced by ilOrgUnitDefaultPermissionTableGUI\__construct().

193  {
194  return $this->context;
195  }
ilOrgUnitOperationContext $context
+ Here is the caller graph for this function:

◆ getContextId()

ilOrgUnitPermission::getContextId ( )
Returns
int

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

References $context_id.

Referenced by afterObjectLoad().

138  : int
139  {
140  return $this->context_id;
141  }
+ Here is the caller graph for this function:

◆ getId()

ilOrgUnitPermission::getId ( )

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

References $id.

Referenced by ilOrgUnitDefaultPermissionTableGUI\__construct().

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

◆ getOperations()

ilOrgUnitPermission::getOperations ( )
Returns
ilOrgUnitOperation[]

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

References $operations.

154  : array
155  {
156  return $this->operations;
157  }

◆ getParentId()

ilOrgUnitPermission::getParentId ( )

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

References $parent_id.

Referenced by isDedicated(), and isTemplate().

167  : int
168  {
169  return $this->parent_id;
170  }
+ Here is the caller graph for this function:

◆ getPositionId()

ilOrgUnitPermission::getPositionId ( )

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

References $position_id.

207  : int
208  {
209  return $this->position_id;
210  }

◆ getPossibleOperations()

ilOrgUnitPermission::getPossibleOperations ( )

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

References $possible_operations.

Referenced by ilOrgUnitDefaultPermissionTableGUI\__construct().

177  : array
178  {
180  }
+ Here is the caller graph for this function:

◆ getSelectedOperationIds()

ilOrgUnitPermission::getSelectedOperationIds ( )

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

References $selected_operation_ids.

182  : array
183  {
185  }

◆ isDedicated()

ilOrgUnitPermission::isDedicated ( )

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

References getParentId().

222  : bool
223  {
224  return ($this->getParentId() != self::PARENT_TEMPLATE);
225  }
+ Here is the call graph for this function:

◆ isNewlyCreated()

ilOrgUnitPermission::isNewlyCreated ( )

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

References $newly_created.

237  : bool
238  {
239  return $this->newly_created;
240  }

◆ isOperationIdSelected()

ilOrgUnitPermission::isOperationIdSelected ( int  $operation_id)

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

Referenced by ilOrgUnitDefaultPermissionTableGUI\fillRow().

187  : bool
188  {
189  return in_array($operation_id, $this->selected_operation_ids);
190  }
+ Here is the caller graph for this function:

◆ isProtected()

ilOrgUnitPermission::isProtected ( )

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

References $protected.

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

227  : bool
228  {
229  return $this->protected;
230  }
bool $protected
true integer 1
+ Here is the caller graph for this function:

◆ isTemplate()

ilOrgUnitPermission::isTemplate ( )

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

References getParentId().

217  : bool
218  {
219  return ($this->getParentId() === self::PARENT_TEMPLATE);
220  }
+ Here is the call graph for this function:

◆ returnDbTableName()

static ilOrgUnitPermission::returnDbTableName ( )
static

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

202  : string
203  {
204  return self::TABLE_NAME;
205  }

◆ setContext()

ilOrgUnitPermission::setContext ( ilOrgUnitOperationContext  $context)

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

References $context.

198  {
199  $this->context = $context;
200  }
ilOrgUnitOperationContext $context

◆ setContextId()

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

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

References $context_id.

146  : void
147  {
148  $this->context_id = $context_id;
149  }

◆ setId()

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

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

References $id.

130  : void
131  {
132  $this->id = $id;
133  }

◆ setNewlyCreated()

ilOrgUnitPermission::setNewlyCreated ( bool  $newly_created)

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

References $newly_created.

243  {
244  $this->newly_created = $newly_created;
245  }

◆ setOperations()

ilOrgUnitPermission::setOperations ( array  $operations)
Parameters
ilOrgUnitOperation[]$operations

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

References $operations.

162  : void
163  {
164  $this->operations = $operations;
165  }

◆ setParentId()

ilOrgUnitPermission::setParentId ( int  $parent_id)

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

References $parent_id.

173  {
174  $this->parent_id = $parent_id;
175  }

◆ setPositionId()

ilOrgUnitPermission::setPositionId ( int  $position_id)

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

References $position_id.

213  {
214  $this->position_id = $position_id;
215  }

◆ setProtected()

ilOrgUnitPermission::setProtected ( bool  $protected)

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

References $protected.

232  : void
233  {
234  $this->protected = $protected;
235  }
bool $protected
true integer 1

◆ sleep()

ilOrgUnitPermission::sleep (   $field_name)

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

248  {
249  switch ($field_name) {
250  case 'operations':
251  $ids = [];
252  foreach ($this->operations as $operation) {
253  $ids[] = $operation->getOperationId();
254  }
255 
256  return json_encode($ids);
257  }
258 
259  return parent::sleep($field_name);
260  }

◆ update()

ilOrgUnitPermission::update ( )

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

References isProtected().

88  : void
89  {
90  if ($this->isProtected()) {
91  throw new ilException('Cannot modify a protected ilOrgUnitPermission');
92  }
93  parent::update();
94  }
+ 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 267 of file class.ilOrgUnitPermission.php.

References $operations, and ilOrgUnitOperationQueries\findById().

268  {
269  switch ($field_name) {
270  case 'operations':
271  $ids = json_decode($field_value);
272  $ids = is_array($ids) ? $ids : array();
273  $operations = [];
274  foreach ($ids as $id) {
275  $ilOrgUnitOperation = ilOrgUnitOperationQueries::findById($id);
276  if ($ilOrgUnitOperation) {
277  $operations[] = $ilOrgUnitOperation;
278  }
279  }
280 
281  return $operations;
282  }
283 
284  return parent::wakeUp($field_name, $field_value);
285  }
+ Here is the call graph for this function:

Field Documentation

◆ $context

ilOrgUnitOperationContext ilOrgUnitPermission::$context = null
protected

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

Referenced by getContext(), and setContext().

◆ $context_id

int ilOrgUnitPermission::$context_id = 0
protected

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

Referenced by getContextId(), and setContextId().

◆ $id

int ilOrgUnitPermission::$id = 0
protected

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

Referenced by getId(), and setId().

◆ $newly_created

bool ilOrgUnitPermission::$newly_created = false
protected

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

Referenced by isNewlyCreated(), and setNewlyCreated().

◆ $operations

array ilOrgUnitPermission::$operations = []
protected

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

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

◆ $parent_id

int ilOrgUnitPermission::$parent_id = self::PARENT_TEMPLATE
protected

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

Referenced by getParentId(), and setParentId().

◆ $position_id

int ilOrgUnitPermission::$position_id = 0
protected

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

Referenced by getPositionId(), and setPositionId().

◆ $possible_operations

array ilOrgUnitPermission::$possible_operations = []
protected

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

Referenced by getPossibleOperations().

◆ $protected

bool ilOrgUnitPermission::$protected = false
protected

true integer 1

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

Referenced by isProtected(), and setProtected().

◆ $selected_operation_ids

array ilOrgUnitPermission::$selected_operation_ids = []
protected

Definition at line 58 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 26 of file class.ilOrgUnitPermission.php.


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