You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UserRepositoryQuery.php 1.1KB

пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace Lc\SovBundle\Repository\User;
  3. use App\Entity\Merchant\Merchant;
  4. use App\Entity\Newsletter\Newsletter;
  5. use Knp\Component\Pager\PaginatorInterface;
  6. use Lc\SovBundle\Repository\AbstractRepositoryQuery;
  7. class UserRepositoryQuery extends AbstractRepositoryQuery implements UserRepositoryQueryInterface
  8. {
  9. public function __construct(UserRepository $repository, PaginatorInterface $paginator)
  10. {
  11. parent::__construct($repository, 'r', $paginator);
  12. }
  13. public function filterByNewsletter(Newsletter $newsletter): self
  14. {
  15. return $this
  16. ->andWhere(':newsletter MEMBER OF .newsletters')
  17. ->setParameter('newsletter', $newsletter->getId());
  18. }
  19. public function filterLikeRole(string $role): self
  20. {
  21. return $this
  22. ->andWhere('.roles LIKE :roles')
  23. ->setParameter('roles', '%"' . $role . '"%');
  24. }
  25. public function filterLikeTicketTypeNotification(string $ticketType): self
  26. {
  27. return $this
  28. ->andWhere('.ticketTypesNotification LIKE :ticketType')
  29. ->setParameter('ticketType', '%"' . $ticketType . '"%');
  30. }
  31. }