ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
TopParentItem.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
28
32class TopParentItem extends AbstractBaseItem implements
33 isItem,
39{
42
46 protected array $children = [];
47 protected ?Symbol $symbol = null;
48 protected string $title = "";
49
53 public function __construct(IdentificationInterface $provider_identification)
54 {
55 parent::__construct($provider_identification);
56 $this->renderer = new TopParentItemRenderer();
57 }
58
63 {
64 $clone = clone($this);
65 $clone->symbol = $symbol;
66
67 return $clone;
68 }
69
73 public function getSymbol(): Symbol
74 {
75 return $this->symbol;
76 }
77
81 public function hasSymbol(): bool
82 {
83 return ($this->symbol instanceof Symbol);
84 }
85
89 public function withTitle(string $title): hasTitle
90 {
91 $clone = clone($this);
92 $clone->title = $title;
93
94 return $clone;
95 }
96
100 public function getTitle(): string
101 {
102 return $this->title;
103 }
104
108 public function getChildren(): array
109 {
110 return $this->children;
111 }
112
116 public function withChildren(array $children): isParent
117 {
118 $clone = clone($this);
119 $clone->children = $children;
120
121 return $clone;
122 }
123
127 public function appendChild(isChild $child): isParent
128 {
129 $this->children[] = $child;
130
131 return $this;
132 }
133
137 public function hasChildren(): bool
138 {
139 return $this->children !== [];
140 }
141}
renderer()
__construct(IdentificationInterface $provider_identification)
@inheritDoc
This describes a symbol.
Definition: Symbol.php:30
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc