ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
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.

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

62  : ActiveRecord /*ilOrgUnitOperationContext|ActiveRecord*/
63  {
64  return ilOrgUnitOperationContext::find($id);
65  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ 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.

References ActiveRecord\where().

Referenced by ilOrgUnitOperationQueries\findByOperationString(), ILIAS\MyStaff\ilMyStaffAccess\getIdsForPositionAndOperation(), ilOrgUnitOperationQueries\getOperationsForContextName(), and ilOrgUnitPermissionQueries\getTemplateSetForContextName().

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)
+ 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.

References ilObject\_lookupType().

75  {
76  $type_context = ilObject2::_lookupType($obj_id, false);
77 
78  return self::findByName($type_context);
79  }
static _lookupType(int $id, bool $reference=false)
+ 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.

References ilObject\_lookupType().

Referenced by ilOrgUnitPermissionQueries\getContextByRefId().

68  {
69  $type_context = ilObject2::_lookupType($ref_id, true);
70 
71  return self::findByName($type_context);
72  }
$ref_id
Definition: ltiauth.php:67
static _lookupType(int $id, bool $reference=false)
+ 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.

References $context, and ActiveRecord\where().

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  }
$context
Definition: webdav.php:29
static where($where, $operator=null)
+ 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: