ILIAS  release_8 Revision v8.24
class.ilConditionFactory.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5/******************************************************************************
6 *
7 * This file is part of ILIAS, a powerful learning management system
8 * published by ILIAS open source e-Learning e.V.
9 *
10 * ILIAS is licensed with the GPL-3.0,
11 * see https://www.gnu.org/licenses/gpl-3.0.en.html
12 * You should have received a copy of said license along with the
13 * source code, too.
14 *
15 * If this is not the case or you just want to try ILIAS, you'll find
16 * us at:
17 * https://www.ilias.de
18 * https://github.com/ILIAS-eLearning
19 *
20 *****************************************************************************/
21
27{
29
31 {
32 if (is_null($cond_obj_adapter)) {
33 $this->cond_obj_adapter = new ilConditionObjectAdapter();
34 } else {
35 $this->cond_obj_adapter = $cond_obj_adapter;
36 }
37 }
38
43 {
44 $obj_id = $this->cond_obj_adapter->getObjIdForRefId($ref_id);
45 $obj_type = $this->cond_obj_adapter->getTypeForObjId($obj_id);
46 return new ilConditionTrigger($ref_id, $obj_id, $obj_type);
47 }
48
53 public function set(array $conditions): ilConditionSet
54 {
55 return new ilConditionSet($conditions);
56 }
57
58 public function condition(ilConditionTrigger $trigger, string $operator, ?string $value = null): ilCondition
59 {
60 return new ilCondition($trigger, $operator, $value);
61 }
62
64 {
65 return new ilConditionOperatorFactory();
66 }
67}
repositoryTrigger(int $ref_id)
Repository condition trigger object.
ilConditionObjectAdapterInterface $cond_obj_adapter
__construct(ilConditionObjectAdapterInterface $cond_obj_adapter=null)
condition(ilConditionTrigger $trigger, string $operator, ?string $value=null)
Currently wraps standard operator constants.
Condition set Note: This object currently focuses on repository objects as targets.
Represents a condition trigger object.
Condition class.
$ref_id
Definition: ltiauth.php:67