ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilCondition.php
Go to the documentation of this file.
1 <?php
2 
3 declare(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 
28 {
30  protected string $operator;
31  protected ?string $value;
32  protected bool $obligatory = false;
33  protected int $id;
34 
35  public function __construct(ilConditionTrigger $trigger, string $operator, ?string $value = null)
36  {
37  $this->trigger = $trigger;
38  $this->operator = $operator;
39  $this->value = $value;
40  }
41 
42  public function getTrigger(): ilConditionTrigger
43  {
44  return $this->trigger;
45  }
46 
47  public function getOperator(): string
48  {
49  return $this->operator;
50  }
51 
52  public function getValue(): ?string
53  {
54  return $this->value;
55  }
56 
57  public function withObligatory(bool $obligatory): ilCondition
58  {
59  $clone = clone $this;
60  $clone->obligatory = $obligatory;
61  return $clone;
62  }
63 
64  public function getObligatory(): bool
65  {
66  return $this->obligatory;
67  }
68 
69  public function withId(int $id): ilCondition
70  {
71  $clone = clone $this;
72  $clone->id = $id;
73  return $clone;
74  }
75 
76  public function getId(): int
77  {
78  return $this->id;
79  }
80 }
Condition class.
Represents a condition trigger object.
withObligatory(bool $obligatory)
__construct(ilConditionTrigger $trigger, string $operator,?string $value=null)
ilConditionTrigger $trigger