ILIAS  release_8 Revision v8.24
ilOrgUnitOperationContextQueries Class Reference

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

+ Collaboration diagram for ilOrgUnitOperationContextQueries:

Static Public Member Functions

static registerNewContext (string $context_name, ?string $parent_context=null)
 
static findByName (string $context_name)
 
static findById (int $id)
 
static findByRefId (int $ref_id)
 
static findByObjId (int $obj_id)
 

Static Protected Attributes

static array $instance_by_name = array()
 

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 ilOrgUnitOperationContextQueries

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

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

Member Function Documentation

◆ findById()

static ilOrgUnitOperationContextQueries::findById ( int  $id)
static

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

62 : ActiveRecord /*ilOrgUnitOperationContext|ActiveRecord*/
63 {
64 return ilOrgUnitOperationContext::find($id);
65 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
Class ActiveRecord.

References $id.

Referenced by ilOrgUnitPermission\afterObjectLoad(), and ilOrgUnitOperationQueries\getOperationsForContextId().

+ Here is the caller graph for this function:

◆ findByName()

static ilOrgUnitOperationContextQueries::findByName ( string  $context_name)
static

Definition at line 52 of file class.ilOrgUnitOperationContextQueries.php.

53 {
54 if (!isset(self::$instance_by_name[$context_name])) {
55 self::$instance_by_name[$context_name] = ilOrgUnitOperationContext::where(array('context' => $context_name))
56 ->first();
57 }
58
59 return self::$instance_by_name[$context_name];
60 }
static where($where, $operator=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ActiveRecord\where().

Referenced by findByObjId(), ilOrgUnitOperationQueries\findByOperationString(), findByRefId(), ilOrgUnitOperationQueries\getOperationsForContextName(), and ilOrgUnitPermissionQueries\getTemplateSetForContextName().

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

◆ findByObjId()

static ilOrgUnitOperationContextQueries::findByObjId ( int  $obj_id)
static

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

75 {
76 $type_context = ilObject2::_lookupType($obj_id, false);
77
78 return self::findByName($type_context);
79 }
static _lookupType(int $id, bool $reference=false)

References ilObject\_lookupType(), and findByName().

+ Here is the call graph for this function:

◆ findByRefId()

static ilOrgUnitOperationContextQueries::findByRefId ( int  $ref_id)
static

Definition at line 67 of file class.ilOrgUnitOperationContextQueries.php.

68 {
69 $type_context = ilObject2::_lookupType($ref_id, true);
70
71 return self::findByName($type_context);
72 }
$ref_id
Definition: ltiauth.php:67

References $ref_id, ilObject\_lookupType(), and findByName().

Referenced by ilOrgUnitPermissionQueries\getContextByRefId().

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

◆ registerNewContext()

static ilOrgUnitOperationContextQueries::registerNewContext ( string  $context_name,
?string  $parent_context = null 
)
static
Exceptions
ilException

Definition at line 28 of file class.ilOrgUnitOperationContextQueries.php.

28 : void
29 {
30 if (ilOrgUnitOperationContext::where(array('context' => $context_name))->hasSets()) {
31 throw new ilException('Context already registered');
32 }
33
34 $parentList = ilOrgUnitOperationContext::where(array('context' => $parent_context));
35 $parent_id = 0;
36 if ($parent_context !== null && $parentList->hasSets()) {
37 $parent = $parentList->first();
38 if ($parent === null) {
39 throw new ilException('No record found');
40 }
41 $parent_id = $parent->getId();
42 }
43
45 $context->setContext($context_name);
46 $context->setParentContextId($parent_id);
47 $context->create();
48 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$context
Definition: webdav.php:29

References $context, and ActiveRecord\where().

+ Here is the call graph for this function:

Field Documentation

◆ $instance_by_name

array ilOrgUnitOperationContextQueries::$instance_by_name = array()
staticprotected

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


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