ILIAS  release_8 Revision v8.23
class.ilConditionSet.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 
30 {
31  protected ?bool $hidden_status = null;
32  protected ?bool $all_obligatory = null;
36  protected array $conditions;
37  protected ?int $num_obligatory = null;
38 
42  public function __construct(array $conditions)
43  {
44  $this->conditions = $conditions;
45  }
46 
50  public function getConditions(): array
51  {
52  return $this->conditions;
53  }
54 
58  public function withHiddenStatus(bool $hidden_status): ilConditionSet
59  {
60  $clone = clone $this;
61  $clone->hidden_status = $hidden_status;
62  return $clone;
63  }
64 
65  public function getHiddenStatus(): ?bool
66  {
67  return $this->hidden_status;
68  }
69 
73  public function withAllObligatory(): ilConditionSet
74  {
75  $clone = clone $this;
76  $clone->all_obligatory = true;
77  return $clone;
78  }
79 
80  public function getAllObligatory(): ?bool
81  {
82  return $this->all_obligatory;
83  }
84 
88  public function withNumObligatory(int $num_obligatory): ilConditionSet
89  {
90  $clone = clone $this;
91  $clone->num_obligatory = $num_obligatory;
92  return $clone;
93  }
94 
98  public function getNumObligatory(): ?int
99  {
100  return $this->num_obligatory;
101  }
102 }
withAllObligatory()
Set all conditions being obligatory (standard behaviour)
getNumObligatory()
Get number of obligatory conditions.
Condition set Note: This object currently focuses on repository objects as targets.
withNumObligatory(int $num_obligatory)
Set number of obligatory conditions.
__construct(array $conditions)
withHiddenStatus(bool $hidden_status)
Set hidden status (trigger objects should be hidden in presentation)