1 | <?php |
||
21 | class Route extends BaseRoute implements RouteInterface |
||
22 | { |
||
23 | use RouteTrait, ArticlesAwareTrait; |
||
24 | |||
25 | /** |
||
26 | * @var int |
||
27 | */ |
||
28 | protected $id; |
||
29 | |||
30 | /** |
||
31 | * @var RouteInterface |
||
32 | */ |
||
33 | protected $root; |
||
34 | |||
35 | /** |
||
36 | * @var RouteInterface |
||
37 | */ |
||
38 | protected $parent; |
||
39 | |||
40 | /** |
||
41 | * @var Collection|RouteInterface[] |
||
42 | */ |
||
43 | protected $children; |
||
44 | |||
45 | /** |
||
46 | * @var int |
||
47 | */ |
||
48 | protected $lft; |
||
49 | |||
50 | /** |
||
51 | * @var int |
||
52 | */ |
||
53 | protected $rgt; |
||
54 | |||
55 | /** |
||
56 | * @var int |
||
57 | */ |
||
58 | protected $level; |
||
59 | |||
60 | /** |
||
61 | * Route constructor. |
||
62 | */ |
||
63 | public function __construct() |
||
70 | 104 | ||
71 | 104 | /** |
|
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public function getId() |
||
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | public function getRouteName() |
||
86 | |||
87 | /** |
||
88 | * @param ArticleInterface $article |
||
89 | */ |
||
90 | public function addArticle(ArticleInterface $article): void |
||
97 | |||
98 | /** |
||
99 | * {@inheritdoc} |
||
100 | */ |
||
101 | public function isRoot(): bool |
||
105 | |||
106 | /** |
||
107 | * {@inheritdoc} |
||
108 | */ |
||
109 | public function getRoot(): RouteInterface |
||
113 | |||
114 | /** |
||
115 | * {@inheritdoc} |
||
116 | */ |
||
117 | public function getParent() |
||
121 | |||
122 | /** |
||
123 | * {@inheritdoc} |
||
124 | */ |
||
125 | public function setParent(RouteInterface $parent = null) |
||
129 | |||
130 | /** |
||
131 | * @return Collection|RouteInterface[] |
||
132 | */ |
||
133 | public function getChildren() |
||
137 | |||
138 | /** |
||
139 | * {@inheritdoc} |
||
140 | */ |
||
141 | public function hasChild(RouteInterface $route): bool |
||
145 | |||
146 | /** |
||
147 | * {@inheritdoc} |
||
148 | */ |
||
149 | public function addChild(RouteInterface $route) |
||
156 | |||
157 | /** |
||
158 | * {@inheritdoc} |
||
159 | */ |
||
160 | public function removeChild(RouteInterface $route) |
||
167 | |||
168 | /** |
||
169 | * {@inheritdoc} |
||
170 | */ |
||
171 | public function getLeft(): int |
||
175 | |||
176 | /** |
||
177 | * {@inheritdoc} |
||
178 | */ |
||
179 | public function setLeft(int $left) |
||
183 | |||
184 | /** |
||
185 | * {@inheritdoc} |
||
186 | */ |
||
187 | public function getRight(): int |
||
191 | |||
192 | /** |
||
193 | * @param int $right |
||
194 | */ |
||
195 | public function setRight(int $right) |
||
199 | |||
200 | /** |
||
201 | * {@inheritdoc} |
||
202 | */ |
||
203 | public function getLevel(): int |
||
207 | |||
208 | /** |
||
209 | * {@inheritdoc} |
||
210 | */ |
||
211 | public function setLevel(int $level) |
||
215 | |||
216 | /** |
||
217 | * {@inheritdoc} |
||
218 | */ |
||
219 | public function getParentId() |
||
225 | |||
226 | /** |
||
227 | * {@inheritdoc} |
||
228 | */ |
||
229 | public function getRootId() |
||
235 | } |
||
236 |