ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
Entity.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 
31 use ILIAS\UI\Component\Listing\Property as PropertyListing;
33 
35 
36 abstract class Entity implements I\Entity
37 {
38  use ComponentHelper;
39 
43  protected array $blocking_conditions = [];
47  protected array $featured_props = [];
51  protected array $main_details = [];
55  protected array $prio_reactions = [];
59  protected array $reactions = [];
63  protected array $availability = [];
67  protected array $details = [];
71  protected array $actions = [];
75  protected array $personal_status = [];
76 
77  public function __construct(
78  protected Symbol | Image | Shy | StandardLink | string $primary_identifier,
79  protected Symbol | Image | Shy | StandardLink | string $secondary_identifier
80  ) {
81  }
82 
83  public function withPrimaryIdentifier(Symbol | Image | Shy | StandardLink | string $primary_identifier): self
84  {
85  $clone = clone $this;
86  $clone->primary_identifier = $primary_identifier;
87  return $clone;
88  }
89  public function getPrimaryIdentifier(): Symbol | Image | Shy | StandardLink | string
90  {
91  return $this->primary_identifier;
92  }
93 
94  public function withSecondaryIdentifier(Symbol | Image | Shy | StandardLink | string $secondary_identifier): self
95  {
96  $clone = clone $this;
97  $clone->secondary_identifier = $secondary_identifier;
98  return $clone;
99  }
100  public function getSecondaryIdentifier(): Symbol | Image | Shy | StandardLink | string
101  {
102  return $this->secondary_identifier;
103  }
104 
109  PropertyListing | StandardLink | Legacy ...$blocking_conditions
110  ): self {
111  $clone = clone $this;
112  $clone->blocking_conditions = $blocking_conditions;
113  return $clone;
114  }
118  public function getBlockingAvailabilityConditions(): array
119  {
121  }
122 
126  public function withFeaturedProperties(
127  PropertyListing | StandardLink | Legacy ...$featured_props
128  ): self {
129  $clone = clone $this;
130  $clone->featured_props = $featured_props;
131  return $clone;
132  }
136  public function getFeaturedProperties(): array
137  {
138  return $this->featured_props;
139  }
140 
144  public function withMainDetails(
145  PropertyListing | Legacy ...$main_details
146  ): self {
147  $clone = clone $this;
148  $clone->main_details = $main_details;
149  return $clone;
150  }
154  public function getMainDetails(): array
155  {
156  return $this->main_details;
157  }
158 
162  public function withPrioritizedReactions(Glyph | Tag ...$prio_reactions): self
163  {
164  $this->checkArgListElements(
165  "Entity Prioritized Reactions",
166  $prio_reactions,
167  [Glyph::class, Tag::class]
168  );
169  $clone = clone $this;
170  $clone->prio_reactions = $prio_reactions;
171  return $clone;
172  }
176  public function getPrioritizedReactions(): array
177  {
178  return $this->prio_reactions;
179  }
180 
184  public function withReactions(Glyph | Tag ...$reactions): self
185  {
186  $this->checkArgListElements(
187  "Entity Reactions",
188  $reactions,
189  [Glyph::class, Tag::class]
190  );
191 
192  $clone = clone $this;
193  $clone->reactions = $reactions;
194  return $clone;
195  }
199  public function getReactions(): array
200  {
201  return $this->reactions;
202  }
203 
207  public function withAvailability(
208  PropertyListing | StandardLink | Legacy ...$availability
209  ): self {
210  $clone = clone $this;
211  $clone->availability = $availability;
212  return $clone;
213  }
217  public function getAvailability(): array
218  {
219  return $this->availability;
220  }
221 
225  public function withDetails(
226  PropertyListing | Legacy ...$details
227  ): self {
228  $clone = clone $this;
229  $clone->details = $details;
230  return $clone;
231  }
235  public function getDetails(): array
236  {
237  return $this->details;
238  }
239 
243  public function withActions(Shy ...$actions): self
244  {
245  $clone = clone $this;
246  $clone->actions = $actions;
247  return $clone;
248  }
252  public function getActions(): array
253  {
254  return $this->actions;
255  }
256 
260  public function withPersonalStatus(
261  PropertyListing | Legacy ...$personal_status
262  ): self {
263  $clone = clone $this;
264  $clone->personal_status = $personal_status;
265  return $clone;
266  }
270  public function getPersonalStatus(): array
271  {
272  return $this->personal_status;
273  }
274 }
withSecondaryIdentifier(Symbol|Image|Shy|StandardLink|string $secondary_identifier)
Definition: Entity.php:94
withPrimaryIdentifier(Symbol|Image|Shy|StandardLink|string $primary_identifier)
Definition: Entity.php:83
This describes a symbol.
Definition: Symbol.php:29
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
withDetails(PropertyListing|Legacy ... $details)
Definition: Entity.php:225
withPersonalStatus(PropertyListing|Legacy ... $personal_status)
Definition: Entity.php:260
withBlockingAvailabilityConditions(PropertyListing|StandardLink|Legacy ... $blocking_conditions)
Definition: Entity.php:108
This describes a tag(-button).
Definition: Tag.php:28
withAvailability(PropertyListing|StandardLink|Legacy ... $availability)
Definition: Entity.php:207
This describes how a glyph could be modified during construction of UI.
Definition: Glyph.php:30
withPrioritizedReactions(Glyph|Tag ... $prio_reactions)
Definition: Entity.php:162
__construct(protected Symbol|Image|Shy|StandardLink|string $primary_identifier, protected Symbol|Image|Shy|StandardLink|string $secondary_identifier)
Definition: Entity.php:77
withReactions(Glyph|Tag ... $reactions)
Definition: Entity.php:184
withFeaturedProperties(PropertyListing|StandardLink|Legacy ... $featured_props)
Definition: Entity.php:126
withMainDetails(PropertyListing|Legacy ... $main_details)
Definition: Entity.php:144