ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
Lost.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use Closure;
40
44class Lost extends AbstractBaseItem implements
48 isChild,
53{
55 private array $children = [];
57 private string $title = '';
58
62 public function __construct(IdentificationInterface $provider_identification)
63 {
64 parent::__construct($provider_identification);
65 $this->parent = new NullIdentification();
66 }
67
71 public function withTitle(string $title): hasTitle
72 {
73 $this->title = $title;
74
75 return $this;
76 }
77
81 public function getTitle(): string
82 {
83 return $this->title;
84 }
85
89 public function withContent(Component $ui_component): hasContent
90 {
91 return $this;
92 }
93
97 public function withContentWrapper(Closure $content_wrapper): hasContent
98 {
99 return $this;
100 }
101
105 public function getContent(): Component
106 {
107 global $DIC;
108
109 return $DIC->ui()->factory()->legacy()->content("");
110 }
111
115 public function withParent(IdentificationInterface $identification): isItem
116 {
117 $this->parent = $identification;
118
119 return $this;
120 }
121
125 public function hasParent(): bool
126 {
127 return $this->parent instanceof isParent;
128 }
129
134 {
135 return $this->parent;
136 }
137
141 public function overrideParent(IdentificationInterface $identification): isItem
142 {
143 $this->parent = $identification;
144
145 return $this;
146 }
147
151 public function getChildren(): array
152 {
153 return $this->children;
154 }
155
160 public function withChildren(array $children): isParent
161 {
162 $this->children = $children;
163
164 return $this;
165 }
166
170 public function appendChild(isItem $child): isParent
171 {
172 $this->children[] = $child;
173
174 return $this;
175 }
176
180 public function removeChild(isItem $child): isParent
181 {
182 $this->children = array_filter($this->children, static fn(isItem $item): bool => $item->getProviderIdentification()->serialize() !== $child->getProviderIdentification()->serialize());
183
184 return $this;
185 }
186
190 public function hasChildren(): bool
191 {
192 return $this->children !== [];
193 }
194
198 public function withAction(string $action): hasAction
199 {
200 // noting to to
201 return $this;
202 }
203
207 public function getAction(): string
208 {
209 return "#";
210 }
211
215 public function withIsLinkToExternalAction(bool $is_external): hasAction
216 {
217 // noting to to
218 return $this;
219 }
220
224 public function isLinkWithExternalAction(): bool
225 {
226 return false;
227 }
228
232 public function withSymbol(Symbol $symbol): hasSymbol
233 {
234 return $this;
235 }
236
240 public function getSymbol(): Symbol
241 {
242 return new Glyph(Glyph::MORE, '');
243 }
244
248 public function hasSymbol(): bool
249 {
250 return false;
251 }
252
253 public function getAmountOfChildren(bool $including_dropped = true): int
254 {
255 return 0;
256 }
257
258 public function calculateAmountOfChildren(): void
259 {
260 // nothing to do
261 }
262
263}
overrideParent(IdentificationInterface $identification)
@inheritDoc
Definition: Lost.php:141
withParent(IdentificationInterface $identification)
@inheritDoc
Definition: Lost.php:115
withContent(Component $ui_component)
@inheritDoc
Definition: Lost.php:89
withIsLinkToExternalAction(bool $is_external)
@inheritDoc
Definition: Lost.php:215
getAmountOfChildren(bool $including_dropped=true)
Definition: Lost.php:253
withChildren(array $children)
@inheritDoc
Definition: Lost.php:160
__construct(IdentificationInterface $provider_identification)
@inheritDoc
Definition: Lost.php:62
withContentWrapper(Closure $content_wrapper)
@inheritDoc
Definition: Lost.php:97
A component is the most general form of an entity in the UI.
Definition: Component.php:28
This describes a symbol.
Definition: Symbol.php:30
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26