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.

UserStore.php 1.1KB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace Lc\SovBundle\Repository\User;
  3. use App\Entity\Newsletter\Newsletter;
  4. use Lc\SovBundle\Repository\AbstractStore;
  5. class UserStore extends AbstractStore implements UserStoreInterface
  6. {
  7. protected UserRepositoryQueryInterface $query;
  8. public function __construct(UserRepositoryQueryInterface $query)
  9. {
  10. $this->query = $query;
  11. }
  12. //findAllByNewsletter
  13. public function getByNewsletter(Newsletter $newsletter, $query = null): array
  14. {
  15. if (is_null($query)) {
  16. $query = $this->query->create();
  17. }
  18. $query
  19. ->filterByNewsletter($newsletter);
  20. return $query->find();
  21. }
  22. //findByRole
  23. public function getByRole(string $role): array
  24. {
  25. $query = $this->query->create();
  26. $query
  27. ->filterLikeRole($role);
  28. return $query->find();
  29. }
  30. //findByTicketTypesNotification
  31. public function getByTicketTypesNotification(string $ticketType): array
  32. {
  33. $query = $this->query->create();
  34. $query
  35. ->filterLikeTicketTypeNotification($ticketType);
  36. return $query->find();
  37. }
  38. }