ILIAS
trunk Revision v11.0_alpha-2645-g16283d3b3f8
◀ ilDoc Overview
AbstractParentItem.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\GlobalScreen\Scope\MainMenu\Factory
;
22
27
abstract
class
AbstractParentItem
extends
AbstractBaseItem
implements
isParent
28
{
32
protected
array
$children
= [];
33
37
public
function
getChildren
(): array
38
{
39
return
$this->children
;
40
}
41
45
public
function
withChildren
(array $children):
isParent
46
{
47
$clone = clone($this);
48
$clone->children =
$children
;
49
50
return
$clone;
51
}
52
56
public
function
appendChild
(
isItem
$child):
isParent
57
{
58
$this->children[] = $child;
59
60
return
$this;
61
}
62
66
public
function
hasChildren
(): bool
67
{
68
return
($this->children !== []);
69
}
70
74
public
function
removeChild
(
isItem
$child_to_remove):
isParent
75
{
76
$this->children = array_filter($this->children,
static
fn(
isItem
$item):
bool
=> $item !== $child_to_remove);
77
78
return
$this;
79
}
80
}
ILIAS\GlobalScreen\Scope\MainMenu\Factory\AbstractParentItem\withChildren
withChildren(array $children)
Definition:
AbstractParentItem.php:45
ILIAS\GlobalScreen\Scope\MainMenu\Factory\AbstractBaseItem
Definition:
AbstractBaseItem.php:34
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isItem
Interface IFactory.
Definition:
isItem.php:31
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isParent
Interface isParent.
Definition:
isParent.php:26
ILIAS\GlobalScreen\Scope\MainMenu\Factory\AbstractParentItem\$children
array $children
Definition:
AbstractParentItem.php:32
ILIAS\GlobalScreen\Scope\MainMenu\Factory\AbstractParentItem\appendChild
appendChild(isItem $child)
Definition:
AbstractParentItem.php:56
ILIAS\GlobalScreen\Scope\MainMenu\Factory\AbstractParentItem\getChildren
getChildren()
Definition:
AbstractParentItem.php:37
ILIAS\GlobalScreen\Scope\MainMenu\Factory\AbstractParentItem
Class AbstractParentItem.
Definition:
AbstractParentItem.php:27
ILIAS\GlobalScreen\Scope\MainMenu\Factory\AbstractParentItem\removeChild
removeChild(isItem $child_to_remove)
Definition:
AbstractParentItem.php:74
ILIAS\GlobalScreen\Scope\MainMenu\Factory
Definition:
AbstractBaseItem.php:21
ILIAS\GlobalScreen\Scope\MainMenu\Factory\AbstractParentItem\hasChildren
hasChildren()
Definition:
AbstractParentItem.php:66
components
ILIAS
GlobalScreen
src
Scope
MainMenu
Factory
AbstractParentItem.php
Generated on Mon Sep 1 2025 23:03:11 for ILIAS by
1.8.13 (using
Doxyfile
)