ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Lost.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use Closure;
38
42class Lost extends AbstractBaseItem implements
46 isChild,
50{
51 private array $children = [];
53 private string $title = '';
54
58 public function __construct(IdentificationInterface $provider_identification)
59 {
60 parent::__construct($provider_identification);
61 $this->parent = new NullIdentification();
62 }
63
67 public function withTitle(string $title): hasTitle
68 {
69 $this->title = $title;
70
71 return $this;
72 }
73
77 public function getTitle(): string
78 {
79 return $this->title;
80 }
81
85 public function withContent(Component $ui_component): hasContent
86 {
87 return $this;
88 }
89
93 public function withContentWrapper(Closure $content_wrapper): hasContent
94 {
95 return $this;
96 }
97
101 public function getContent(): Component
102 {
103 global $DIC;
104
105 return $DIC->ui()->factory()->legacy()->content("");
106 }
107
111 public function withParent(IdentificationInterface $identification): isItem
112 {
113 $this->parent = $identification;
114
115 return $this;
116 }
117
121 public function hasParent(): bool
122 {
123 return $this->parent instanceof isParent;
124 }
125
130 {
131 return $this->parent;
132 }
133
137 public function overrideParent(IdentificationInterface $identification): isItem
138 {
139 $this->parent = $identification;
140
141 return $this;
142 }
143
147 public function getChildren(): array
148 {
149 return $this->children;
150 }
151
156 public function withChildren(array $children): isParent
157 {
158 $this->children = $children;
159
160 return $this;
161 }
162
166 public function appendChild(isItem $child): isParent
167 {
168 $this->children[] = $child;
169
170 return $this;
171 }
172
176 public function removeChild(isItem $child): isParent
177 {
178 $this->children = array_filter($this->children, static fn(isItem $item): bool => $item->getProviderIdentification()->serialize() !== $child->getProviderIdentification()->serialize());
179
180 return $this;
181 }
182
186 public function hasChildren(): bool
187 {
188 return $this->children !== [];
189 }
190
194 public function withAction(string $action): hasAction
195 {
196 // noting to to
197 return $this;
198 }
199
203 public function getAction(): string
204 {
205 return "#";
206 }
207
211 public function withIsLinkToExternalAction(bool $is_external): hasAction
212 {
213 // noting to to
214 return $this;
215 }
216
220 public function isLinkWithExternalAction(): bool
221 {
222 return false;
223 }
224
228 public function withSymbol(Symbol $symbol): hasSymbol
229 {
230 return $this;
231 }
232
236 public function getSymbol(): Symbol
237 {
238 return new Glyph(Glyph::MORE, '');
239 }
240
244 public function hasSymbol(): bool
245 {
246 return false;
247 }
248
249 public function getAmountOfChildren(bool $including_dropped = true): int
250 {
251 return 0;
252 }
253
254 public function calculateAmountOfChildren(): void
255 {
256 // nothing to do
257 }
258
259}
overrideParent(IdentificationInterface $identification)
@inheritDoc
Definition: Lost.php:137
withParent(IdentificationInterface $identification)
@inheritDoc
Definition: Lost.php:111
withContent(Component $ui_component)
@inheritDoc
Definition: Lost.php:85
withIsLinkToExternalAction(bool $is_external)
@inheritDoc
Definition: Lost.php:211
getAmountOfChildren(bool $including_dropped=true)
Definition: Lost.php:249
withChildren(array $children)
@inheritDoc
Definition: Lost.php:156
__construct(IdentificationInterface $provider_identification)
@inheritDoc
Definition: Lost.php:58
withContentWrapper(Closure $content_wrapper)
@inheritDoc
Definition: Lost.php:93
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