ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
TopParentItem.php
Go to the documentation of this file.
2
7
14{
15
19 protected $children = [];
23 protected $glyph;
27 protected $title = "";
28
29
34 {
36 $this->renderer = new TopParentItemRenderer();
37 }
38
39
43 public function withSymbol(Symbol $symbol) : hasSymbol
44 {
45 $clone = clone($this);
46 $clone->glyph = $symbol;
47
48 return $clone;
49 }
50
51
55 public function getSymbol() : Symbol
56 {
57 return $this->glyph;
58 }
59
60
64 public function hasSymbol() : bool
65 {
66 return ($this->glyph instanceof Symbol);
67 }
68
69
73 public function withTitle(string $title) : hasTitle
74 {
75 $clone = clone($this);
76 $clone->title = $title;
77
78 return $clone;
79 }
80
81
85 public function getTitle() : string
86 {
87 return $this->title;
88 }
89
90
94 public function getChildren() : array
95 {
96 return $this->children;
97 }
98
99
103 public function withChildren(array $children) : isParent
104 {
105 $clone = clone($this);
106 $clone->children = $children;
107
108 return $clone;
109 }
110
111
115 public function appendChild(isChild $child) : isParent
116 {
117 $this->children[] = $child;
118
119 return $this;
120 }
121
122
126 public function hasChildren() : bool
127 {
128 return count($this->children) > 0;
129 }
130}
An exception for terminatinating execution or to throw for unit testing.
__construct(IdentificationInterface $provider_identification)
@inheritDoc
This describes how a glyph could be modified during construction of UI.
Definition: Glyph.php:14
This describes a symbol.
Definition: Symbol.php:12
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc