|
1234567891011121314151617181920212223242526272829303132333435 |
- <?php
-
- namespace Lc\SovBundle\Repository\Ticket;
-
- use Knp\Component\Pager\PaginatorInterface;
- use Lc\SovBundle\Model\User\UserInterface;
- use Lc\SovBundle\Repository\AbstractRepositoryQuery;
-
- class TicketRepositoryQuery extends AbstractRepositoryQuery implements TicketRepositoryQueryInterface
- {
- public function __construct(TicketRepository $repository, PaginatorInterface $paginator)
- {
- parent::__construct($repository, 'r', $paginator);
- }
-
- public function filterByUser(UserInterface $user): self
- {
- return $this
- ->andWhere('.user = :user')
- ->setParameter('user', $user);
- }
-
- public function filterByStatus($statusArray): self
- {
- return $this
- ->andWhere('.status IN (:status)')
- ->setParameter('status', $statusArray);
- }
-
- public function selectCount(): self
- {
- return $this
- ->select('count(r.id) as count');
- }
- }
|