Total Complexity | 9 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
15 | trait SortableTrait |
||
16 | { |
||
17 | /** |
||
18 | * @ORM\Column(type="integer", nullable=false) |
||
19 | * @Groups({"default"}) |
||
20 | * @var int|null |
||
21 | */ |
||
22 | protected $sort; |
||
23 | |||
24 | /** |
||
25 | * @return int|null |
||
26 | */ |
||
27 | public function getSort(): ?int |
||
28 | { |
||
29 | return $this->sort; |
||
30 | 5 | } |
|
31 | |||
32 | 5 | /** |
|
33 | * @param int $sort |
||
34 | * @return SortableTrait|SortableInterface |
||
35 | */ |
||
36 | public function setSort(int $sort = 0) |
||
40 | } |
||
41 | 5 | ||
42 | 5 | final public function calculateSort(?bool $sortLast = null, ?Collection $sortCollection = null): int |
|
56 | 4 | } |
|
57 | 4 | ||
58 | 4 | /** |
|
59 | * @return Collection|null |
||
60 | 1 | */ |
|
61 | 1 | abstract public function getSortCollection(): ?Collection; |
|
62 | } |
||
63 |