Nie możesz wybrać więcej, niż 25 tematów
Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
|
- <?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
- ->filterByRole($role);
-
- return $query->find();
- }
-
- //findByTicketTypesNotification
- public function getByTicketTypesNotification(string $ticketType): array
- {
- $query = $this->query->create();
- $query
- ->filterByTicketTypeNotification($ticketType);
-
- return $query->find();
- }
-
- public function getOneByEmail(string $email)
- {
- $query = $this->query->create();
- $query
- ->filterByEmail($email);
-
- return $query->findOne();
- }
- }
|