Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

TicketRepository.php 1.3KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace Lc\ShopBundle\Repository;
  3. use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
  4. use Doctrine\Persistence\ManagerRegistry;
  5. use Lc\ShopBundle\Context\DefaultRepositoryInterface;
  6. use Lc\ShopBundle\Context\TicketInterface;
  7. use Lc\ShopBundle\Context\UnitInterface;
  8. use Lc\ShopBundle\Model\Ticket;
  9. use Lc\ShopBundle\Repository\BaseRepository;
  10. /**
  11. * @method TicketInterface|null find($id, $lockMode = null, $lockVersion = null)
  12. * @method TicketInterface|null findOneBy(array $criteria, array $orderBy = null)
  13. * @method TicketInterface[] findAll()
  14. * @method TicketInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
  15. */
  16. class TicketRepository extends BaseRepository implements DefaultRepositoryInterface
  17. {
  18. public function getInterfaceClass()
  19. {
  20. return TicketInterface::class;
  21. }
  22. public function findAllOpen()
  23. {
  24. $query = $this->findByMerchantQuery() ;
  25. $query->andWhere('e.status IN (:statusOpen)')->setParameter('statusOpen', [Ticket::TICKET_STATUS_OPEN, Ticket::TICKET_STATUS_BEING_PROCESSED]) ;
  26. $query->addOrderBy('e.id', 'DESC') ;
  27. return $query->getQuery()->getResult() ;
  28. }
  29. }