ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilCondition.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
27{
29 protected string $operator;
30 protected ?string $value;
31 protected bool $obligatory = false;
32 protected int $id;
33
34 public function __construct(ilConditionTrigger $trigger, string $operator, ?string $value = null)
35 {
36 $this->trigger = $trigger;
37 $this->operator = $operator;
38 $this->value = $value;
39 }
40
41 public function getTrigger(): ilConditionTrigger
42 {
43 return $this->trigger;
44 }
45
46 public function getOperator(): string
47 {
48 return $this->operator;
49 }
50
51 public function getValue(): ?string
52 {
53 return $this->value;
54 }
55
56 public function withObligatory(bool $obligatory): ilCondition
57 {
58 $clone = clone $this;
59 $clone->obligatory = $obligatory;
60 return $clone;
61 }
62
63 public function getObligatory(): bool
64 {
65 return $this->obligatory;
66 }
67
68 public function withId(int $id): ilCondition
69 {
70 $clone = clone $this;
71 $clone->id = $id;
72 return $clone;
73 }
74
75 public function getId(): int
76 {
77 return $this->id;
78 }
79}
Represents a condition trigger object.
Condition class.
ilConditionTrigger $trigger
withObligatory(bool $obligatory)
__construct(ilConditionTrigger $trigger, string $operator, ?string $value=null)