ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
Lost.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
23 use Closure;
40 
44 class Lost extends AbstractBaseItem implements
45  hasContent,
46  isTopItem,
47  isParent,
48  isChild,
49  hasTitle,
50  hasAction,
51  hasSymbol
52 {
53  private array $children = [];
55  private string $title = '';
56 
60  public function __construct(IdentificationInterface $provider_identification)
61  {
62  parent::__construct($provider_identification);
63  $this->parent = new NullIdentification();
64  }
65 
69  public function withTitle(string $title): hasTitle
70  {
71  $this->title = $title;
72 
73  return $this;
74  }
75 
79  public function getTitle(): string
80  {
81  return $this->title;
82  }
83 
87  public function withContent(Component $ui_component): hasContent
88  {
89  return $this;
90  }
91 
95  public function withContentWrapper(Closure $content_wrapper): hasContent
96  {
97  return $this;
98  }
99 
103  public function getContent(): Component
104  {
105  global $DIC;
106 
107  return $DIC->ui()->factory()->legacy("");
108  }
109 
113  public function withParent(IdentificationInterface $identification): isItem
114  {
115  $this->parent = $identification;
116 
117  return $this;
118  }
119 
123  public function hasParent(): bool
124  {
125  return $this->parent instanceof isParent;
126  }
127 
132  {
133  return $this->parent;
134  }
135 
139  public function overrideParent(IdentificationInterface $identification): isItem
140  {
141  $this->parent = $identification;
142 
143  return $this;
144  }
145 
149  public function getChildren(): array
150  {
151  return $this->children;
152  }
153 
158  public function withChildren(array $children): isParent
159  {
160  $this->children = $children;
161 
162  return $this;
163  }
164 
168  public function appendChild(isItem $child): isParent
169  {
170  $this->children[] = $child;
171 
172  return $this;
173  }
174 
178  public function removeChild(isItem $child): isParent
179  {
180  $this->children = array_filter($this->children, static fn(isItem $item): bool => $item->getProviderIdentification()->serialize() !== $child->getProviderIdentification()->serialize());
181 
182  return $this;
183  }
184 
188  public function hasChildren(): bool
189  {
190  return $this->children !== [];
191  }
192 
196  public function withAction(string $action): hasAction
197  {
198  // noting to to
199  return $this;
200  }
201 
205  public function getAction(): string
206  {
207  return "#";
208  }
209 
213  public function withIsLinkToExternalAction(bool $is_external): hasAction
214  {
215  // noting to to
216  return $this;
217  }
218 
222  public function isLinkWithExternalAction(): bool
223  {
224  return false;
225  }
226 
230  public function withSymbol(Symbol $symbol): hasSymbol
231  {
232  return $this;
233  }
234 
238  public function getSymbol(): Symbol
239  {
240  return new Glyph(Glyph::MORE, '');
241  }
242 
246  public function hasSymbol(): bool
247  {
248  return false;
249  }
250 }
overrideParent(IdentificationInterface $identification)
Definition: Lost.php:139
This describes a symbol.
Definition: Symbol.php:29
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(IdentificationInterface $provider_identification)
Definition: Lost.php:60
global $DIC
Definition: shib_login.php:25
__construct(Container $dic, ilPlugin $plugin)
withParent(IdentificationInterface $identification)
Definition: Lost.php:113
withContentWrapper(Closure $content_wrapper)
Definition: Lost.php:95