ILIAS  release_8 Revision v8.24
Lost.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use Closure;
39
45{
47
48 private array $children = [];
50 private string $title = '';
51
56 {
58 $this->parent = new NullIdentification();
59 }
60
64 public function withTitle(string $title): hasTitle
65 {
66 $this->title = $title;
67
68 return $this;
69 }
70
74 public function getTitle(): string
75 {
76 return $this->title;
77 }
78
82 public function withContent(Component $ui_component): hasContent
83 {
84 return $this;
85 }
86
90 public function withContentWrapper(Closure $content_wrapper): hasContent
91 {
92 return $this;
93 }
94
98 public function getContent(): Component
99 {
100 global $DIC;
101
102 return $DIC->ui()->factory()->legacy("");
103 }
104
108 public function withParent(IdentificationInterface $identification): isItem
109 {
110 $this->parent = $identification;
111
112 return $this;
113 }
114
118 public function hasParent(): bool
119 {
120 return $this->parent instanceof isParent;
121 }
122
127 {
128 return $this->parent;
129 }
130
134 public function overrideParent(IdentificationInterface $identification): isItem
135 {
136 $this->parent = $identification;
137
138 return $this;
139 }
140
144 public function getChildren(): array
145 {
146 return $this->children;
147 }
148
153 public function withChildren(array $children): isParent
154 {
155 $this->children = $children;
156
157 return $this;
158 }
159
163 public function appendChild(isItem $child): isParent
164 {
165 $this->children[] = $child;
166
167 return $this;
168 }
169
173 public function removeChild(isItem $child): isParent
174 {
175 $this->children = array_filter($this->children, static function (isItem $item) use ($child): bool {
176 return $item->getProviderIdentification()->serialize() !== $child->getProviderIdentification()->serialize();
177 });
178
179 return $this;
180 }
181
185 public function hasChildren(): bool
186 {
187 return $this->children !== [];
188 }
189
193 public function withAction(string $action): hasAction
194 {
195 // noting to to
196 return $this;
197 }
198
202 public function getAction(): string
203 {
204 return "#";
205 }
206
210 public function withIsLinkToExternalAction(bool $is_external): hasAction
211 {
212 // noting to to
213 return $this;
214 }
215
219 public function isLinkWithExternalAction(): bool
220 {
221 return false;
222 }
223
227 public function withSymbol(Symbol $symbol): hasSymbol
228 {
229 return $this;
230 }
231
235 public function getSymbol(): Symbol
236 {
237 return new Glyph(Glyph::MORE, '');
238 }
239
243 public function hasSymbol(): bool
244 {
245 return false;
246 }
247}
overrideParent(IdentificationInterface $identification)
@inheritDoc
Definition: Lost.php:134
withParent(IdentificationInterface $identification)
@inheritDoc
Definition: Lost.php:108
withContent(Component $ui_component)
@inheritDoc
Definition: Lost.php:82
withIsLinkToExternalAction(bool $is_external)
@inheritDoc
Definition: Lost.php:210
withChildren(array $children)
@inheritDoc
Definition: Lost.php:153
__construct(IdentificationInterface $provider_identification)
@inheritDoc
Definition: Lost.php:55
withContentWrapper(Closure $content_wrapper)
@inheritDoc
Definition: Lost.php:90
global $DIC
Definition: feed.php:28
Interface hasSymbol Methods for Entries with Symbols.
Definition: hasSymbol.php:33
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Complex.php:21
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...