|
12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
-
- namespace Lc\SovBundle\Repository\User;
-
- use App\Entity\Merchant\Merchant;
- use App\Entity\Newsletter\Newsletter;
- use Knp\Component\Pager\PaginatorInterface;
- use Lc\SovBundle\Repository\AbstractRepositoryQuery;
-
- class UserRepositoryQuery extends AbstractRepositoryQuery implements UserRepositoryQueryInterface
- {
- public function __construct(UserRepository $repository, PaginatorInterface $paginator)
- {
- parent::__construct($repository, 'r', $paginator);
- }
-
- public function filterByNewsletter(Newsletter $newsletter): self
- {
- return $this
- ->andWhere(':newsletter MEMBER OF .newsletters')
- ->setParameter('newsletter', $newsletter->getId());
- }
-
- public function filterLikeRole(string $role): self
- {
- return $this
- ->andWhere('.roles LIKE :roles')
- ->setParameter('roles', '%"' . $role . '"%');
- }
-
- public function filterLikeTicketTypeNotification(string $ticketType): self
- {
- return $this
- ->andWhere('.ticketTypesNotification LIKE :ticketType')
- ->setParameter('ticketType', '%"' . $ticketType . '"%');
- }
- }
|