1 | <?php |
||
11 | class RootNavigationItem implements Item |
||
12 | { |
||
13 | /** @var string */ |
||
14 | private $identifier; |
||
15 | /** @var string */ |
||
16 | private $label; |
||
17 | /** @var Item[] */ |
||
18 | private $children; |
||
19 | |||
20 | public function __construct(string $identifier, string $label = null) |
||
25 | |||
26 | /** |
||
27 | * @return string |
||
28 | */ |
||
29 | public function getIdentifier(): string |
||
33 | |||
34 | /** |
||
35 | * @return string |
||
36 | */ |
||
37 | public function getLabel(): string |
||
41 | |||
42 | /** |
||
43 | * @return array |
||
44 | */ |
||
45 | public function getChildren(): array |
||
49 | |||
50 | /** |
||
51 | * @param Item $item |
||
52 | * @return Item |
||
53 | */ |
||
54 | public function addChild(Item $item) |
||
60 | |||
61 | /** |
||
62 | * @param Item $parent |
||
63 | * @return Item |
||
64 | * @throws \Exception |
||
65 | */ |
||
66 | public function setParent(Item $parent) |
||
70 | |||
71 | /** |
||
72 | * @return Item|null |
||
73 | */ |
||
74 | public function getParent() |
||
78 | } |
||
79 |