Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

QueryBuilder.php 732B

pirms 3 gadiem
12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace Lc\SovBundle\Doctrine;
  3. use Doctrine\ORM\QueryBuilder as DoctrineQueryBuilder;
  4. /**
  5. * class QueryBuilder.
  6. *
  7. * @author La clic !!!!
  8. */
  9. class QueryBuilder extends DoctrineQueryBuilder
  10. {
  11. public function andWhereParent($dqlId, $entityId):self
  12. {
  13. $this->andWhere($dqlId.'.parent = :entityId');
  14. $this->setParameter('entityId', $entityId);
  15. return $this;
  16. }
  17. public function andWhereParentIsNull($dqlId):self
  18. {
  19. $this->andWhere($dqlId.'.parent IS NULL');
  20. return $this;
  21. }
  22. public function andWhereStatus($dqlId, $status){
  23. $this->andWhere($dqlId.'.status = :status');
  24. $this->setParameter('status', $status);
  25. return $this;
  26. }
  27. }