Total Complexity | 6 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
9 | trait PageRelatedPagesTrait |
||
10 | { |
||
11 | /** |
||
12 | * @ORM\ManyToMany(targetEntity="PiedWeb\CMSBundle\Entity\PageInterface") |
||
13 | */ |
||
14 | protected $relatedPages; |
||
15 | |||
16 | public function __constructRelatedPagesT() |
||
19 | } |
||
20 | |||
21 | /** |
||
22 | * @return Collection|Page[] |
||
23 | */ |
||
24 | public function getRelatedPages(): Collection |
||
25 | { |
||
26 | return $this->relatedPages; |
||
27 | } |
||
28 | |||
29 | public function addRelatedPage(PageInterface $relatedPage): self |
||
30 | { |
||
31 | if (! $this->relatedPages->contains($relatedPage)) { |
||
32 | $this->relatedPages[] = $relatedPage; |
||
33 | } |
||
34 | |||
35 | return $this; |
||
36 | } |
||
37 | |||
38 | public function removeRelatedPage(PageInterface $relatedPage): self |
||
45 | } |
||
46 | } |
||
47 |