|
- <?php
-
- namespace Lc\SovBundle\Repository;
-
- use Lc\SovBundle\Doctrine\EntityInterface;
-
- trait TreeRepositoryQueryTrait
- {
- public function filterIsParent()
- {
- return $this->andWhere('.parent is NULL');
- }
-
- public function filterIsChildren()
- {
- return $this->andWhere('.parent is NOT NULL');
- }
-
- public function filterByParent(EntityInterface $parent)
- {
- return $this->andWhere('.parent = :parent')->setParameter('parent', $parent);
- }
-
- }
|