ILIAS  release_8 Revision v8.24
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 ()
 @description 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 ()
 @depracated 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
 @con_has_field true @con_fieldtype integer @con_length 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 ()
 @description Returns an instance of the instatiated calling active record (needs to be done in static methods) @TODO : 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)
Parameters
mixed$primary_key

Reimplemented from ActiveRecord.

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

83 {
84 parent::__construct($primary_key);
85 $this->afterObjectLoad();
86 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

+ Here is the call graph for this function:

Member Function Documentation

◆ afterObjectLoad()

ilOrgUnitPermission::afterObjectLoad ( )

Reimplemented from ActiveRecord.

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

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 }
120 }
static getOperationsForContextId(string $context_id)

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

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilOrgUnitPermission::create ( )

Reimplemented from ActiveRecord.

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

96 : void
97 {
98 if ($this->isProtected()) {
99 throw new ilException('Cannot modify a protected ilOrgUnitPermission');
100 }
101 parent::create();
102 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References isProtected().

+ Here is the call graph for this function:

◆ delete()

ilOrgUnitPermission::delete ( )

Reimplemented from ActiveRecord.

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

104 : void
105 {
106 if ($this->isProtected()) {
107 throw new ilException('Cannot modify a protected ilOrgUnitPermission');
108 }
109 parent::delete();
110 }

References isProtected().

+ Here is the call graph for this function:

◆ getContext()

ilOrgUnitPermission::getContext ( )

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

193 {
194 return $this->context;
195 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilOrgUnitOperationContext $context

References $context.

Referenced by ilOrgUnitDefaultPermissionTableGUI\__construct().

+ Here is the caller graph for this function:

◆ getContextId()

ilOrgUnitPermission::getContextId ( )
Returns
int

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

138 : int
139 {
140 return $this->context_id;
141 }

References $context_id.

Referenced by afterObjectLoad().

+ Here is the caller graph for this function:

◆ getId()

ilOrgUnitPermission::getId ( )

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

122 : ?int
123 {
124 return $this->id;
125 }

References $id.

Referenced by ilOrgUnitDefaultPermissionTableGUI\__construct().

+ Here is the caller graph for this function:

◆ getOperations()

ilOrgUnitPermission::getOperations ( )
Returns
ilOrgUnitOperation[]

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

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

References $operations.

◆ getParentId()

ilOrgUnitPermission::getParentId ( )

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

167 : int
168 {
169 return $this->parent_id;
170 }

References $parent_id.

Referenced by isDedicated(), and isTemplate().

+ Here is the caller graph for this function:

◆ getPositionId()

ilOrgUnitPermission::getPositionId ( )

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

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

References $position_id.

◆ getPossibleOperations()

ilOrgUnitPermission::getPossibleOperations ( )

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

177 : array
178 {
180 }

References $possible_operations.

Referenced by ilOrgUnitDefaultPermissionTableGUI\__construct().

+ Here is the caller graph for this function:

◆ getSelectedOperationIds()

ilOrgUnitPermission::getSelectedOperationIds ( )

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

182 : array
183 {
185 }

References $selected_operation_ids.

◆ isDedicated()

ilOrgUnitPermission::isDedicated ( )

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

222 : bool
223 {
224 return ($this->getParentId() != self::PARENT_TEMPLATE);
225 }

References getParentId().

+ Here is the call graph for this function:

◆ isNewlyCreated()

ilOrgUnitPermission::isNewlyCreated ( )

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

237 : bool
238 {
240 }

References $newly_created.

◆ isOperationIdSelected()

ilOrgUnitPermission::isOperationIdSelected ( int  $operation_id)

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

187 : bool
188 {
189 return in_array($operation_id, $this->selected_operation_ids);
190 }

Referenced by ilOrgUnitDefaultPermissionTableGUI\fillRow().

+ Here is the caller graph for this function:

◆ isProtected()

ilOrgUnitPermission::isProtected ( )

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

227 : bool
228 {
229 return $this->protected;
230 }
bool $protected
@con_has_field true @con_fieldtype integer @con_length 1

References $protected.

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

+ Here is the caller graph for this function:

◆ isTemplate()

ilOrgUnitPermission::isTemplate ( )

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

217 : bool
218 {
219 return ($this->getParentId() === self::PARENT_TEMPLATE);
220 }

References getParentId().

+ Here is the call graph for this function:

◆ returnDbTableName()

static ilOrgUnitPermission::returnDbTableName ( )
static
Exceptions

arException

Deprecated:

Reimplemented from ActiveRecord.

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

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

References TABLE_NAME.

◆ setContext()

ilOrgUnitPermission::setContext ( ilOrgUnitOperationContext  $context)

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

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

References $context.

◆ setContextId()

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

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

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

References $context_id.

◆ setId()

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

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

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

References $id.

◆ setNewlyCreated()

ilOrgUnitPermission::setNewlyCreated ( bool  $newly_created)

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

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

References $newly_created.

◆ setOperations()

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

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

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

References $operations.

◆ setParentId()

ilOrgUnitPermission::setParentId ( int  $parent_id)

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

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

References $parent_id.

◆ setPositionId()

ilOrgUnitPermission::setPositionId ( int  $position_id)

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

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

References $position_id.

◆ setProtected()

ilOrgUnitPermission::setProtected ( bool  $protected)

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

232 : void
233 {
234 $this->protected = $protected;
235 }

References $protected.

◆ sleep()

ilOrgUnitPermission::sleep (   $field_name)
Parameters
$field_name
Returns
null

Reimplemented from ActiveRecord.

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 ( )

Reimplemented from ActiveRecord.

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

88 : void
89 {
90 if ($this->isProtected()) {
91 throw new ilException('Cannot modify a protected ilOrgUnitPermission');
92 }
93 parent::update();
94 }

References isProtected().

+ Here is the call graph for this function:

◆ wakeUp()

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

Reimplemented from ActiveRecord.

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

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 }

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

+ 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(), setId(), and wakeUp().

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

@con_has_field true @con_fieldtype integer @con_length 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.

Referenced by returnDbTableName().


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