3declare(strict_types=1);
52 $this->
raw =
new ArrayObject();
58 return function (
isItem $item_one,
isItem $item_two):
int {
59 return $item_one->
getPosition() - $item_two->getPosition();
69 if (0 < strlen($serialize)) {
70 $this->
raw[$serialize] = $item;
79 foreach ($items as $item) {
90 if ($this->
raw->offsetExists($identification->serialize())) {
91 $item = $this->
raw->offsetGet($identification->serialize());
93 return $item ?? $this->
getLostItem($identification);
106 if ($this->filtered->offsetExists($identification->serialize())) {
107 $item = $this->filtered->offsetGet($identification->serialize());
110 return $item ?? $this->
getLostItem($identification);
118 $this->
raw->offsetUnset($identification->serialize());
129 return $this->filtered->offsetExists($identification->serialize());
132 public function has(): bool
134 return $this->
raw->count() > 0;
140 if (!isset($this->filtered)) {
141 $this->filtered =
new ArrayObject($this->
raw->getArrayCopy());
143 if (count($this->filters) > 0) {
144 if (!isset($this->filtered)) {
145 $filter_copy = $this->
raw->getArrayCopy();
147 $filter_copy = $this->filtered->getArrayCopy();
149 foreach ($this->filters as $filter) {
150 $filter_copy = array_filter($filter_copy, $filter);
152 $this->filtered->exchangeArray($filter_copy);
181 $to_walk = (array) $this->filtered->getArrayCopy();
182 array_walk($to_walk,
$c);
183 $this->filtered =
new ArrayObject($to_walk);
191 $this->filters[] =
$c;
198 $this->filtered->uasort($this->
getSorter());
200 $replace_children_sorted =
function (
isItem &$item) {
202 $children = $item->getChildren();
204 $item = $item->withChildren($children);
207 $this->
walk($replace_children_sorted);
214 ->withVisibilityCallable(
218 )->withTitle(
'Lost');
Class NullIdentification.
getSingleItemFromRaw(IdentificationInterface $identification)
filter(Closure $c)
@inheritDoc
__construct(MainMenuItemFactory $factory)
Tree constructor.
getSingleItemFromFilter(IdentificationInterface $identification)
existsInFilter(IdentificationInterface $identification)
getLostItem(IdentificationInterface $identification)
walk(Closure $c)
@inheritDoc
addMultiple(isItem ... $items)
MainMenuItemFactory $factory
withAlwaysAvailable(bool $always_active)
@inheritDoc
Class MainMenuItemFactory This factory provides you all available types for MainMenu GlobalScreen Ite...
Interface IdentificationInterface.
getPosition()
Return the default position for installation, this will be overridden by the configuration later.
getProviderIdentification()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...