|
12345678910111213141516171819202122 |
- <?php
-
- namespace Lc\CaracoleBundle\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);
- }
-
- }
|