<?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)
    {
        return $this
                ->andWhere('.user = :user')
                ->setParameter('user', $user);
    }
}
