ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
Lost.php
Go to the documentation of this file.
2
3use Closure;
18
24{
29 private $children = array();
33 private $parent;
37 private $title = '';
38
43 {
45 $this->parent = new NullIdentification();
46 }
47
51 public function withTitle(string $title) : hasTitle
52 {
53 $this->title = $title;
54
55 return $this;
56 }
57
61 public function getTitle() : string
62 {
63 return $this->title;
64 }
65
69 public function withContent(Component $ui_component) : hasContent
70 {
71 return $this;
72 }
73
77 public function withContentWrapper(Closure $content_wrapper) : hasContent
78 {
79 return $this;
80 }
81
85 public function getContent() : Component
86 {
87 global $DIC;
88
89 return $DIC->ui()->factory()->legacy("");
90 }
91
95 public function withParent(IdentificationInterface $identification) : isItem
96 {
97 $this->parent = $identification;
98
99 return $this;
100 }
101
105 public function hasParent() : bool
106 {
107 return $this->parent instanceof isParent;
108 }
109
114 {
115 return $this->parent;
116 }
117
121 public function overrideParent(IdentificationInterface $identification) : isChild
122 {
123 $this->parent = $identification;
124
125 return $this;
126 }
127
131 public function getChildren() : array
132 {
133 return $this->children;
134 }
135
139 public function withChildren(array $children) : isParent
140 {
141 $this->children = $children;
142
143 return $this;
144 }
145
149 public function appendChild(isChild $child) : isParent
150 {
151 $this->children[] = $child;
152
153 return $this;
154 }
155
159 public function removeChild(isChild $child_to_remove) : isParent
160 {
161 $this->children = array_filter($this->children, static function (isItem $item) use ($child_to_remove) : bool {
162 return $item->getProviderIdentification()->serialize() !== $child_to_remove->getProviderIdentification()->serialize();
163 });
164
165 return $this;
166 }
167
171 public function hasChildren() : bool
172 {
173 return count($this->children) > 0;
174 }
175
179 public function withAction(string $action) : hasAction
180 {
181 // noting to to
182 return $this;
183 }
184
188 public function getAction() : string
189 {
190 return "#";
191 }
192
196 public function withIsLinkToExternalAction(bool $is_external) : hasAction
197 {
198 // noting to to
199 return $this;
200 }
201
205 public function isLinkWithExternalAction() : bool
206 {
207 return false;
208 }
209
213 public function withSymbol(Symbol $symbol) : hasSymbol
214 {
215 return $this;
216 }
217
221 public function getSymbol() : Symbol
222 {
223 return null;
224 }
225
229 public function hasSymbol() : bool
230 {
231 return false;
232 }
233}
An exception for terminatinating execution or to throw for unit testing.
overrideParent(IdentificationInterface $identification)
@inheritDoc
Definition: Lost.php:121
appendChild(isChild $child)
@inheritDoc
Definition: Lost.php:149
removeChild(isChild $child_to_remove)
@inheritDoc
Definition: Lost.php:159
withParent(IdentificationInterface $identification)
@inheritDoc
Definition: Lost.php:95
withContent(Component $ui_component)
@inheritDoc
Definition: Lost.php:69
withIsLinkToExternalAction(bool $is_external)
@inheritDoc
Definition: Lost.php:196
withChildren(array $children)
@inheritDoc
Definition: Lost.php:139
__construct(IdentificationInterface $provider_identification)
@inheritDoc
Definition: Lost.php:42
withContentWrapper(Closure $content_wrapper)
@inheritDoc
Definition: Lost.php:77
Interface hasSymbol Methods for Entries with Symbols.
Definition: hasSymbol.php:12
A component is the most general form of an entity in the UI.
Definition: Component.php:14
This describes a symbol.
Definition: Symbol.php:12
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46