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.

36 rindas
946B

  1. <?php
  2. namespace Lc\SovBundle\Repository\Ticket;
  3. use Knp\Component\Pager\PaginatorInterface;
  4. use Lc\SovBundle\Model\User\UserInterface;
  5. use Lc\SovBundle\Repository\AbstractRepositoryQuery;
  6. class TicketRepositoryQuery extends AbstractRepositoryQuery implements TicketRepositoryQueryInterface
  7. {
  8. public function __construct(TicketRepository $repository, PaginatorInterface $paginator)
  9. {
  10. parent::__construct($repository, 'r', $paginator);
  11. }
  12. public function filterByUser(UserInterface $user): self
  13. {
  14. return $this
  15. ->andWhere('.user = :user')
  16. ->setParameter('user', $user);
  17. }
  18. public function filterByStatus($statusArray): self
  19. {
  20. return $this
  21. ->andWhere('.status IN (:status)')
  22. ->setParameter('status', $statusArray);
  23. }
  24. public function selectCount(): self
  25. {
  26. return $this
  27. ->select('count(r.id) as count');
  28. }
  29. }