ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Entity.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
30use ILIAS\UI\Component\Listing\Property as PropertyListing;
31use ILIAS\UI\Component\Link\Standard as StandardLink;
32use ILIAS\UI\Implementation\Component\ComponentHelper;
33
34abstract class Entity implements I\Entity
35{
36 use ComponentHelper;
37
41 protected array $blocking_conditions = [];
45 protected array $featured_props = [];
49 protected array $main_details = [];
53 protected array $prio_reactions = [];
57 protected array $reactions = [];
61 protected array $availability = [];
65 protected array $details = [];
69 protected array $actions = [];
73 protected array $personal_status = [];
74
75 public function __construct(
76 protected Symbol | Image | Shy | StandardLink | string $primary_identifier,
77 protected Symbol | Image | Shy | StandardLink | string $secondary_identifier
78 ) {
79 }
80
81 public function withPrimaryIdentifier(Symbol | Image | Shy | StandardLink | string $primary_identifier): self
82 {
83 $clone = clone $this;
84 $clone->primary_identifier = $primary_identifier;
85 return $clone;
86 }
87 public function getPrimaryIdentifier(): Symbol | Image | Shy | StandardLink | string
88 {
89 return $this->primary_identifier;
90 }
91
92 public function withSecondaryIdentifier(Symbol | Image | Shy | StandardLink | string $secondary_identifier): self
93 {
94 $clone = clone $this;
95 $clone->secondary_identifier = $secondary_identifier;
96 return $clone;
97 }
98 public function getSecondaryIdentifier(): Symbol | Image | Shy | StandardLink | string
99 {
100 return $this->secondary_identifier;
101 }
102
107 PropertyListing | StandardLink | Content ...$blocking_conditions
108 ): self {
109 $clone = clone $this;
110 $clone->blocking_conditions = $blocking_conditions;
111 return $clone;
112 }
116 public function getBlockingAvailabilityConditions(): array
117 {
118 return $this->blocking_conditions;
119 }
120
124 public function withFeaturedProperties(
125 PropertyListing | StandardLink | Content ...$featured_props
126 ): self {
127 $clone = clone $this;
128 $clone->featured_props = $featured_props;
129 return $clone;
130 }
134 public function getFeaturedProperties(): array
135 {
136 return $this->featured_props;
137 }
138
142 public function withMainDetails(
143 PropertyListing | Content ...$main_details
144 ): self {
145 $clone = clone $this;
146 $clone->main_details = $main_details;
147 return $clone;
148 }
152 public function getMainDetails(): array
153 {
154 return $this->main_details;
155 }
156
160 public function withPrioritizedReactions(Glyph | Tag ...$prio_reactions): self
161 {
162 $this->checkArgListElements(
163 "Entity Prioritized Reactions",
164 $prio_reactions,
165 [Glyph::class, Tag::class]
166 );
167 $clone = clone $this;
168 $clone->prio_reactions = $prio_reactions;
169 return $clone;
170 }
174 public function getPrioritizedReactions(): array
175 {
176 return $this->prio_reactions;
177 }
178
182 public function withReactions(Glyph | Tag ...$reactions): self
183 {
184 $this->checkArgListElements(
185 "Entity Reactions",
186 $reactions,
187 [Glyph::class, Tag::class]
188 );
189
190 $clone = clone $this;
191 $clone->reactions = $reactions;
192 return $clone;
193 }
197 public function getReactions(): array
198 {
199 return $this->reactions;
200 }
201
205 public function withAvailability(
206 PropertyListing | StandardLink | Content ...$availability
207 ): self {
208 $clone = clone $this;
209 $clone->availability = $availability;
210 return $clone;
211 }
215 public function getAvailability(): array
216 {
217 return $this->availability;
218 }
219
223 public function withDetails(
224 PropertyListing | Content ...$details
225 ): self {
226 $clone = clone $this;
227 $clone->details = $details;
228 return $clone;
229 }
233 public function getDetails(): array
234 {
235 return $this->details;
236 }
237
241 public function withActions(Shy ...$actions): self
242 {
243 $clone = clone $this;
244 $clone->actions = $actions;
245 return $clone;
246 }
250 public function getActions(): array
251 {
252 return $this->actions;
253 }
254
258 public function withPersonalStatus(
259 PropertyListing | Content ...$personal_status
260 ): self {
261 $clone = clone $this;
262 $clone->personal_status = $personal_status;
263 return $clone;
264 }
268 public function getPersonalStatus(): array
269 {
270 return $this->personal_status;
271 }
272}
withPrioritizedReactions(Glyph|Tag ... $prio_reactions)
Definition: Entity.php:160
withSecondaryIdentifier(Symbol|Image|Shy|StandardLink|string $secondary_identifier)
Definition: Entity.php:92
withAvailability(PropertyListing|StandardLink|Content ... $availability)
Definition: Entity.php:205
withBlockingAvailabilityConditions(PropertyListing|StandardLink|Content ... $blocking_conditions)
Definition: Entity.php:106
__construct(protected Symbol|Image|Shy|StandardLink|string $primary_identifier, protected Symbol|Image|Shy|StandardLink|string $secondary_identifier)
Definition: Entity.php:75
withPersonalStatus(PropertyListing|Content ... $personal_status)
Definition: Entity.php:258
withReactions(Glyph|Tag ... $reactions)
Definition: Entity.php:182
withMainDetails(PropertyListing|Content ... $main_details)
Definition: Entity.php:142
withPrimaryIdentifier(Symbol|Image|Shy|StandardLink|string $primary_identifier)
Definition: Entity.php:81
withDetails(PropertyListing|Content ... $details)
Definition: Entity.php:223
withFeaturedProperties(PropertyListing|StandardLink|Content ... $featured_props)
Definition: Entity.php:124
This describes a tag(-button).
Definition: Tag.php:29
This describes a symbol.
Definition: Symbol.php:30