|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
-
- namespace Lc\SovBundle\Repository\User;
-
- use App\Entity\Newsletter\Newsletter;
- use Lc\SovBundle\Repository\AbstractStore;
-
- class UserStore extends AbstractStore implements UserStoreInterface
- {
- protected UserRepositoryQueryInterface $query;
-
- public function __construct(UserRepositoryQueryInterface $query)
- {
- $this->query = $query;
- }
-
- //findAllByNewsletter
- public function getByNewsletter(Newsletter $newsletter, $query = null): array
- {
- if (is_null($query)) {
- $query = $this->query->create();
- }
-
- $query
- ->filterByNewsletter($newsletter);
-
- return $query->find();
- }
-
- //findByRole
- public function getByRole(string $role): array
- {
- $query = $this->query->create();
- $query
- ->filterLikeRole($role);
-
- return $query->find();
- }
-
- //findByTicketTypesNotification
- public function getByTicketTypesNotification(string $ticketType): array
- {
- $query = $this->query->create();
- $query
- ->filterLikeTicketTypeNotification($ticketType);
-
- return $query->find();
- }
- }
|