/
TaxonInterface.php
99 lines (71 loc) · 2.35 KB
/
TaxonInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Component\Taxonomy\Model;
use Doctrine\Common\Collections\Collection;
use Sylius\Component\Resource\Model\CodeAwareInterface;
use Sylius\Component\Resource\Model\ResourceInterface;
use Sylius\Component\Resource\Model\SlugAwareInterface;
use Sylius\Component\Resource\Model\TranslatableInterface;
use Sylius\Component\Resource\Model\TranslationInterface;
interface TaxonInterface extends CodeAwareInterface, TranslatableInterface, ResourceInterface, SlugAwareInterface
{
public function isRoot(): bool;
/**
* @return TaxonInterface|null
*/
public function getRoot(): ?self;
/**
* @return TaxonInterface|null
*/
public function getParent(): ?self;
/**
* @param TaxonInterface|null $taxon
*/
public function setParent(?self $taxon): void;
/**
* @return Collection|TaxonInterface[]
*/
public function getAncestors(): Collection;
/**
* @return Collection|TaxonInterface[]
*/
public function getChildren(): Collection;
/**
* @param TaxonInterface $taxon
*/
public function hasChild(self $taxon): bool;
public function hasChildren(): bool;
/**
* @param TaxonInterface $taxon
*/
public function addChild(self $taxon): void;
/**
* @param TaxonInterface $taxon
*/
public function removeChild(self $taxon): void;
public function getName(): ?string;
public function setName(?string $name): void;
public function getFullname(string $pathDelimiter = ' / '): ?string;
public function getDescription(): ?string;
public function setDescription(?string $description): void;
public function getLeft(): ?int;
public function setLeft(?int $left): void;
public function getRight(): ?int;
public function setRight(?int $right): void;
public function getLevel(): ?int;
public function setLevel(?int $level): void;
public function getPosition(): ?int;
public function setPosition(?int $position): void;
/**
* @return TaxonTranslationInterface
*/
public function getTranslation(?string $locale = null): TranslationInterface;
}