ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
Lost.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
23 use Closure;
39 
45 {
47 
51  private $children = [];
55  private $parent;
59  private $title = '';
60 
65  {
66  parent::__construct($provider_identification);
67  $this->parent = new NullIdentification();
68  }
69 
73  public function withTitle(string $title) : hasTitle
74  {
75  $this->title = $title;
76 
77  return $this;
78  }
79 
83  public function getTitle() : string
84  {
85  return $this->title;
86  }
87 
91  public function withContent(Component $ui_component) : hasContent
92  {
93  return $this;
94  }
95 
99  public function withContentWrapper(Closure $content_wrapper) : hasContent
100  {
101  return $this;
102  }
103 
107  public function getContent() : Component
108  {
109  global $DIC;
110 
111  return $DIC->ui()->factory()->legacy("");
112  }
113 
117  public function withParent(IdentificationInterface $identification) : isItem
118  {
119  $this->parent = $identification;
120 
121  return $this;
122  }
123 
127  public function hasParent() : bool
128  {
129  return $this->parent instanceof isParent;
130  }
131 
135  public function getParent() : IdentificationInterface
136  {
137  return $this->parent;
138  }
139 
143  public function overrideParent(IdentificationInterface $identification) : isItem
144  {
145  $this->parent = $identification;
146 
147  return $this;
148  }
149 
153  public function getChildren() : array
154  {
155  return $this->children;
156  }
157 
162  public function withChildren(array $children) : isParent
163  {
164  $this->children = $children;
165 
166  return $this;
167  }
168 
172  public function appendChild(isItem $child) : isParent
173  {
174  $this->children[] = $child;
175 
176  return $this;
177  }
178 
182  public function removeChild(isItem $child) : isParent
183  {
184  $this->children = array_filter($this->children, static function (isItem $item) use ($child) : bool {
185  return $item->getProviderIdentification()->serialize() !== $child->getProviderIdentification()->serialize();
186  });
187 
188  return $this;
189  }
190 
194  public function hasChildren() : bool
195  {
196  return $this->children !== [];
197  }
198 
202  public function withAction(string $action) : hasAction
203  {
204  // noting to to
205  return $this;
206  }
207 
211  public function getAction() : string
212  {
213  return "#";
214  }
215 
219  public function withIsLinkToExternalAction(bool $is_external) : hasAction
220  {
221  // noting to to
222  return $this;
223  }
224 
228  public function isLinkWithExternalAction() : bool
229  {
230  return false;
231  }
232 
236  public function withSymbol(Symbol $symbol) : hasSymbol
237  {
238  return $this;
239  }
240 
244  public function getSymbol() : Symbol
245  {
246  return new Glyph(Glyph::MORE, '');
247  }
248 
252  public function hasSymbol() : bool
253  {
254  return false;
255  }
256 }
overrideParent(IdentificationInterface $identification)
Definition: Lost.php:143
This describes a symbol.
Definition: Symbol.php:11
__construct(IdentificationInterface $provider_identification)
Definition: Lost.php:64
global $DIC
Definition: goto.php:24
Interface hasSymbol Methods for Entries with Symbols.
Definition: hasSymbol.php:32
__construct(Container $dic, ilPlugin $plugin)
withParent(IdentificationInterface $identification)
Definition: Lost.php:117
withContentWrapper(Closure $content_wrapper)
Definition: Lost.php:99