ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilConditionUtil.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
4
15{
19 protected $tree;
20
25
29 protected $obj_definition;
30
35 {
36 global $DIC;
37
38 if (is_null($cond_obj_adapter)) {
39 $this->cond_obj_adapter = new ilConditionObjectAdapter();
40 }
41
42 $this->tree = $DIC->repositoryTree();
43 $this->obj_definition = $DIC["objDefinition"];
44 }
45
54 {
55 $ch = new ilConditionHandler();
56 return $ch->getTriggerTypes();
57 }
58
66 {
67 $ch = new ilConditionHandler();
68 return $ch->getOperatorsByTriggerType($a_type);
69 }
70
77 public function isUnderParentControl($ref_id)
78 {
79 // check if parent takes over control of condition
80 $parent = $this->tree->getParentId($ref_id);
81 $parent_obj_id = $this->cond_obj_adapter->getObjIdForRefId($parent);
82 $parent_type = $this->cond_obj_adapter->getTypeForObjId($parent_obj_id);
83
84 $class = $this->obj_definition->getClassName($parent_type);
85 $class_name = "il" . $class . "ConditionController";
86 $location = $this->obj_definition->getLocation($parent_type);
87 // if yes, get from parent
88 if (is_file($location . "/class." . $class_name . ".php")) {
90 $controller = new $class_name();
91 return $controller->isContainerConditionController($parent);
92 }
93
94 return false;
95 }
96}
$location
Definition: buildRTE.php:44
An exception for terminatinating execution or to throw for unit testing.
INTERNAL CLASS: Please do not use in consumer code.
Condition utility object.
__construct(ilConditionObjectAdapterInterface $cond_obj_adapter=null)
Constructor.
getValidRepositoryTriggerTypes()
Get all valid repository trigger object types.
getOperatorsForRepositoryTriggerType($a_type)
Get operators for repository trigger object type.
$a_type
Definition: workflow.php:92
$DIC
Definition: xapitoken.php:46