- <?php
-
- namespace Lc\CaracoleBundle\Repository;
-
- use Lc\CaracoleBundle\Model\Section\SectionInterface;
-
- trait SectionStoreTrait
- {
- protected SectionInterface $section;
-
- public function setSection(SectionInterface $section):self
- {
- $this->section = $section;
-
- return $this;
- }
-
- public function getParents()
- {
- $query = $this->query->create();
- if ($this->section) {
- $query->filterBySection($this->section);
- }
- $query->filterIsParent();
-
- return $query->find();
- }
-
- }
|