|
12345678910111213141516171819202122232425262728293031323334 |
- <?php
-
- namespace Lc\SovBundle\Doctrine;
-
- use Doctrine\ORM\QueryBuilder as DoctrineQueryBuilder;
-
- /**
- * class QueryBuilder.
- *
- * @author La clic !!!!
- */
- class QueryBuilder extends DoctrineQueryBuilder
- {
-
- public function andWhereParent($dqlId, $entityId):self
- {
- $this->andWhere($dqlId.'.parent = :entityId');
- $this->setParameter('entityId', $entityId);
- return $this;
- }
-
- public function andWhereParentIsNull($dqlId):self
- {
- $this->andWhere($dqlId.'.parent IS NULL');
- return $this;
- }
-
- public function andWhereStatus($dqlId, $status){
- $this->andWhere($dqlId.'.status = :status');
- $this->setParameter('status', $status);
- return $this;
- }
-
- }
|