您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

50 行
1.1KB

  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. }