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.3KB

3 년 전
3 년 전
3 년 전
3 년 전
3 년 전
3 년 전
3 년 전
3 년 전
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. ->filterByRole($role);
  28. return $query->find();
  29. }
  30. //findByTicketTypesNotification
  31. public function getByTicketTypesNotification(string $ticketType): array
  32. {
  33. $query = $this->query->create();
  34. $query
  35. ->filterByTicketTypeNotification($ticketType);
  36. return $query->find();
  37. }
  38. public function getOneByEmail(string $email)
  39. {
  40. $query = $this->query->create();
  41. $query
  42. ->filterByEmail($email);
  43. return $query->findOne();
  44. }
  45. }