您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

30 行
553B

  1. <?php
  2. namespace Lc\CaracoleBundle\Repository;
  3. use Lc\CaracoleBundle\Model\Section\SectionInterface;
  4. trait SectionStoreTrait
  5. {
  6. protected SectionInterface $section;
  7. public function setSection(SectionInterface $section):self
  8. {
  9. $this->section = $section;
  10. return $this;
  11. }
  12. public function getParents()
  13. {
  14. $query = $this->query->create();
  15. if ($this->section) {
  16. $query->filterBySection($this->section);
  17. }
  18. $query->filterIsParent();
  19. return $query->find();
  20. }
  21. }