ILIAS  trunk Revision v11.0_alpha-1702-gfd3ecb7f852
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilConditionFactory.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
26 {
28 
29  public function __construct(?ilConditionObjectAdapterInterface $cond_obj_adapter = null)
30  {
31  if (is_null($cond_obj_adapter)) {
32  $this->cond_obj_adapter = new ilConditionObjectAdapter();
33  } else {
34  $this->cond_obj_adapter = $cond_obj_adapter;
35  }
36  }
37 
42  {
43  $obj_id = $this->cond_obj_adapter->getObjIdForRefId($ref_id);
44  $obj_type = $this->cond_obj_adapter->getTypeForObjId($obj_id);
45  return new ilConditionTrigger($ref_id, $obj_id, $obj_type);
46  }
47 
52  public function set(array $conditions): ilConditionSet
53  {
54  return new ilConditionSet($conditions);
55  }
56 
57  public function condition(ilConditionTrigger $trigger, string $operator, ?string $value = null): ilCondition
58  {
59  return new ilCondition($trigger, $operator, $value);
60  }
61 
63  {
64  return new ilConditionOperatorFactory();
65  }
66 }
repositoryTrigger(int $ref_id)
Repository condition trigger object.
Wraps ilObject dependencies.
Condition set Note: This object currently focuses on repository objects as targets.
__construct(?ilConditionObjectAdapterInterface $cond_obj_adapter=null)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Condition class.
$ref_id
Definition: ltiauth.php:65
ilConditionObjectAdapterInterface $cond_obj_adapter
Represents a condition trigger object.
Currently wraps standard operator constants.
condition(ilConditionTrigger $trigger, string $operator,?string $value=null)