ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
TopParentItem.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26
31{
33
37 protected array $children = [];
38 protected ?Symbol $symbol = null;
39 protected string $title = "";
40
44 public function __construct(IdentificationInterface $provider_identification)
45 {
46 parent::__construct($provider_identification);
47 $this->renderer = new TopParentItemRenderer();
48 }
49
54 {
55 $clone = clone($this);
56 $clone->symbol = $symbol;
57
58 return $clone;
59 }
60
64 public function getSymbol(): Symbol
65 {
66 return $this->symbol;
67 }
68
72 public function hasSymbol(): bool
73 {
74 return ($this->symbol instanceof Symbol);
75 }
76
80 public function withTitle(string $title): hasTitle
81 {
82 $clone = clone($this);
83 $clone->title = $title;
84
85 return $clone;
86 }
87
91 public function getTitle(): string
92 {
93 return $this->title;
94 }
95
99 public function getChildren(): array
100 {
101 return $this->children;
102 }
103
107 public function withChildren(array $children): isParent
108 {
109 $clone = clone($this);
110 $clone->children = $children;
111
112 return $clone;
113 }
114
118 public function appendChild(isChild $child): isParent
119 {
120 $this->children[] = $child;
121
122 return $this;
123 }
124
128 public function hasChildren(): bool
129 {
130 return $this->children !== [];
131 }
132}
renderer()
__construct(IdentificationInterface $provider_identification)
@inheritDoc
This describes a symbol.
Definition: Symbol.php:30
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc