ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
Entity.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
30use ILIAS\UI\Component\Button\Standard as StandardButton;
31use ILIAS\UI\Component\Listing\Property as PropertyListing;
32use ILIAS\UI\Component\Link\Standard as StandardLink;
33use ILIAS\UI\Implementation\Component\ComponentHelper;
35
36abstract 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 $managing_actions = [];
75 protected array $personal_status = [];
76
77 protected ?Workflow\Linear $workflow = null;
78
79 public function __construct(
80 protected string|int $id,
81 protected Symbol | Image | Shy | StandardLink | string $primary_identifier,
82 protected Symbol | Image | Shy | StandardLink | string $secondary_identifier
83 ) {
84 }
85
86 public function getId(): string|int
87 {
88 return $this->id;
89 }
90
91 public function withPrimaryIdentifier(Symbol | Image | Shy | StandardLink | string $primary_identifier): self
92 {
93 $clone = clone $this;
94 $clone->primary_identifier = $primary_identifier;
95 return $clone;
96 }
97 public function getPrimaryIdentifier(): Symbol | Image | Shy | StandardLink | string
98 {
99 return $this->primary_identifier;
100 }
101
102 public function withSecondaryIdentifier(Symbol | Image | Shy | StandardLink | string $secondary_identifier): self
103 {
104 $clone = clone $this;
105 $clone->secondary_identifier = $secondary_identifier;
106 return $clone;
107 }
108 public function getSecondaryIdentifier(): Symbol | Image | Shy | StandardLink | string
109 {
110 return $this->secondary_identifier;
111 }
112
117 PropertyListing | StandardLink | Content ...$blocking_conditions
118 ): self {
119 $clone = clone $this;
120 $clone->blocking_conditions = $blocking_conditions;
121 return $clone;
122 }
126 public function getBlockingAvailabilityConditions(): array
127 {
128 return $this->blocking_conditions;
129 }
130
134 public function withFeaturedProperties(
135 PropertyListing | StandardLink | Content ...$featured_props
136 ): self {
137 $clone = clone $this;
138 $clone->featured_props = $featured_props;
139 return $clone;
140 }
144 public function getFeaturedProperties(): array
145 {
146 return $this->featured_props;
147 }
148
152 public function withMainDetails(
153 PropertyListing | Content ...$main_details
154 ): self {
155 $clone = clone $this;
156 $clone->main_details = $main_details;
157 return $clone;
158 }
162 public function getMainDetails(): array
163 {
164 return $this->main_details;
165 }
166
170 public function withPrioritizedReactions(Glyph | Tag | StandardButton | Shy ...$prio_reactions): self
171 {
172 $this->checkArgListElements(
173 "Entity Prioritized Reactions",
174 $prio_reactions,
175 [Glyph::class, Tag::class, StandardButton::class, Shy::class]
176 );
177 $clone = clone $this;
178 $clone->prio_reactions = $prio_reactions;
179 return $clone;
180 }
184 public function getPrioritizedReactions(): array
185 {
186 return $this->prio_reactions;
187 }
188
192 public function withReactions(Glyph | Tag | Shy | StandardButton ...$reactions): self
193 {
194 $this->checkArgListElements(
195 "Entity Reactions",
196 $reactions,
197 [Glyph::class, Tag::class, Shy::class, StandardButton::class]
198 );
199
200 $clone = clone $this;
201 $clone->reactions = $reactions;
202 return $clone;
203 }
207 public function getReactions(): array
208 {
209 return $this->reactions;
210 }
211
215 public function withAvailability(
216 PropertyListing | StandardLink | Content ...$availability
217 ): self {
218 $clone = clone $this;
219 $clone->availability = $availability;
220 return $clone;
221 }
225 public function getAvailability(): array
226 {
227 return $this->availability;
228 }
229
233 public function withDetails(
234 PropertyListing | Content ...$details
235 ): self {
236 $clone = clone $this;
237 $clone->details = $details;
238 return $clone;
239 }
243 public function getDetails(): array
244 {
245 return $this->details;
246 }
247
248 public function withManagingActions(Shy ...$managing_actions): static
249 {
250 $clone = clone $this;
251 $clone->managing_actions = $managing_actions;
252 return $clone;
253 }
254
258 public function withActions(Shy ...$actions): self
259 {
260 return $this->withManagingActions(...$actions);
261 }
262
266 public function getManagingActions(): array
267 {
268 return $this->managing_actions;
269 }
270
274 public function withPersonalStatus(
275 PropertyListing | Content ...$personal_status
276 ): self {
277 $clone = clone $this;
278 $clone->personal_status = $personal_status;
279 return $clone;
280 }
284 public function getPersonalStatus(): array
285 {
286 return $this->personal_status;
287 }
288
289 public function withWorkflow(Workflow\Linear $workflow): static
290 {
291 $clone = clone $this;
292 $clone->workflow = $workflow;
293 return $clone;
294 }
295
296 public function getWorkflow(): ?Workflow\Linear
297 {
298 return $this->workflow;
299 }
300}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
withPrioritizedReactions(Glyph|Tag|StandardButton|Shy ... $prio_reactions)
Definition: Entity.php:170
withSecondaryIdentifier(Symbol|Image|Shy|StandardLink|string $secondary_identifier)
Definition: Entity.php:102
withReactions(Glyph|Tag|Shy|StandardButton ... $reactions)
Definition: Entity.php:192
withAvailability(PropertyListing|StandardLink|Content ... $availability)
Definition: Entity.php:215
withBlockingAvailabilityConditions(PropertyListing|StandardLink|Content ... $blocking_conditions)
Definition: Entity.php:116
withPersonalStatus(PropertyListing|Content ... $personal_status)
Definition: Entity.php:274
withWorkflow(Workflow\Linear $workflow)
Definition: Entity.php:289
withMainDetails(PropertyListing|Content ... $main_details)
Definition: Entity.php:152
withPrimaryIdentifier(Symbol|Image|Shy|StandardLink|string $primary_identifier)
Definition: Entity.php:91
withDetails(PropertyListing|Content ... $details)
Definition: Entity.php:233
__construct(protected string|int $id, protected Symbol|Image|Shy|StandardLink|string $primary_identifier, protected Symbol|Image|Shy|StandardLink|string $secondary_identifier)
Definition: Entity.php:79
withManagingActions(Shy ... $managing_actions)
Definition: Entity.php:248
withFeaturedProperties(PropertyListing|StandardLink|Content ... $featured_props)
Definition: Entity.php:134
This describes a standard button.
Definition: Standard.php:27
This describes a tag(-button).
Definition: Tag.php:29
This describes a Linear Workflow.
Definition: Linear.php:27
This describes a symbol.
Definition: Symbol.php:30