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