1 | <?php |
||
21 | class Taxon implements TaxonInterface |
||
22 | { |
||
23 | use TranslatableTrait { |
||
24 | __construct as private initializeTranslationsCollection; |
||
25 | getTranslation as private doGetTranslation; |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * @var mixed |
||
30 | */ |
||
31 | protected $id; |
||
32 | |||
33 | /** |
||
34 | * @var string|null |
||
35 | */ |
||
36 | protected $code; |
||
37 | |||
38 | /** |
||
39 | * @var TaxonInterface|null |
||
40 | */ |
||
41 | protected $root; |
||
42 | |||
43 | /** |
||
44 | * @var TaxonInterface|null |
||
45 | */ |
||
46 | protected $parent; |
||
47 | |||
48 | /** |
||
49 | * @var Collection|TaxonInterface[] |
||
50 | */ |
||
51 | protected $children; |
||
52 | |||
53 | /** |
||
54 | * @var int|null |
||
55 | */ |
||
56 | protected $left; |
||
57 | |||
58 | /** |
||
59 | * @var int|null |
||
60 | */ |
||
61 | protected $right; |
||
62 | |||
63 | /** |
||
64 | * @var int|null |
||
65 | */ |
||
66 | protected $level; |
||
67 | |||
68 | /** |
||
69 | * @var int|null |
||
70 | */ |
||
71 | protected $position; |
||
72 | |||
73 | public function __construct() |
||
79 | |||
80 | /** |
||
81 | * @return string |
||
82 | */ |
||
83 | public function __toString(): string |
||
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | */ |
||
91 | public function getId() |
||
95 | |||
96 | /** |
||
97 | * {@inheritdoc} |
||
98 | */ |
||
99 | public function getCode(): ?string |
||
103 | |||
104 | /** |
||
105 | * {@inheritdoc} |
||
106 | */ |
||
107 | public function setCode(?string $code): void |
||
111 | |||
112 | /** |
||
113 | * {@inheritdoc} |
||
114 | */ |
||
115 | public function isRoot(): bool |
||
119 | |||
120 | /** |
||
121 | * {@inheritdoc} |
||
122 | */ |
||
123 | public function getRoot(): ?TaxonInterface |
||
127 | |||
128 | /** |
||
129 | * {@inheritdoc} |
||
130 | */ |
||
131 | public function getParent(): ?TaxonInterface |
||
135 | |||
136 | /** |
||
137 | * {@inheritdoc} |
||
138 | */ |
||
139 | public function setParent(?TaxonInterface $parent): void |
||
146 | |||
147 | /** |
||
148 | * {@inheritdoc} |
||
149 | */ |
||
150 | public function getAncestors(): Collection |
||
160 | |||
161 | /** |
||
162 | * {@inheritdoc} |
||
163 | */ |
||
164 | public function getChildren(): Collection |
||
168 | |||
169 | /** |
||
170 | * {@inheritdoc} |
||
171 | */ |
||
172 | public function hasChild(TaxonInterface $taxon): bool |
||
176 | |||
177 | /** |
||
178 | * {@inheritdoc} |
||
179 | */ |
||
180 | public function hasChildren(): bool |
||
184 | |||
185 | /** |
||
186 | * {@inheritdoc} |
||
187 | */ |
||
188 | public function addChild(TaxonInterface $taxon): void |
||
198 | |||
199 | /** |
||
200 | * {@inheritdoc} |
||
201 | */ |
||
202 | public function removeChild(TaxonInterface $taxon): void |
||
210 | |||
211 | /** |
||
212 | * {@inheritdoc} |
||
213 | */ |
||
214 | public function getName(): ?string |
||
218 | |||
219 | /** |
||
220 | * {@inheritdoc} |
||
221 | */ |
||
222 | public function setName(?string $name): void |
||
226 | |||
227 | /** |
||
228 | * {@inheritdoc} |
||
229 | */ |
||
230 | public function getSlug(): ?string |
||
234 | |||
235 | /** |
||
236 | * {@inheritdoc} |
||
237 | */ |
||
238 | public function setSlug(?string $slug): void |
||
242 | |||
243 | /** |
||
244 | * {@inheritdoc} |
||
245 | */ |
||
246 | public function getDescription(): ?string |
||
250 | |||
251 | /** |
||
252 | * {@inheritdoc} |
||
253 | */ |
||
254 | public function setDescription(?string $description): void |
||
258 | |||
259 | /** |
||
260 | * {@inheritdoc} |
||
261 | */ |
||
262 | public function getLeft(): ?int |
||
266 | |||
267 | /** |
||
268 | * {@inheritdoc} |
||
269 | */ |
||
270 | public function setLeft(?int $left): void |
||
274 | |||
275 | /** |
||
276 | * {@inheritdoc} |
||
277 | */ |
||
278 | public function getRight(): ?int |
||
282 | |||
283 | /** |
||
284 | * {@inheritdoc} |
||
285 | */ |
||
286 | public function setRight(?int $right): void |
||
290 | |||
291 | /** |
||
292 | * {@inheritdoc} |
||
293 | */ |
||
294 | public function getLevel(): ?int |
||
298 | |||
299 | /** |
||
300 | * {@inheritdoc} |
||
301 | */ |
||
302 | public function setLevel(?int $level): void |
||
306 | |||
307 | /** |
||
308 | * {@inheritdoc} |
||
309 | */ |
||
310 | public function getPosition(): ?int |
||
314 | |||
315 | /** |
||
316 | * {@inheritdoc} |
||
317 | */ |
||
318 | public function setPosition(?int $position): void |
||
322 | |||
323 | /** |
||
324 | * @param string|null $locale |
||
325 | * |
||
326 | * @return TaxonTranslationInterface |
||
327 | */ |
||
328 | public function getTranslation(?string $locale = null): TranslationInterface |
||
335 | |||
336 | /** |
||
337 | * {@inheritdoc} |
||
338 | */ |
||
339 | protected function createTranslation(): TaxonTranslation |
||
343 | } |
||
344 |