|
1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
-
- namespace domain\Ticket\TicketUser;
-
- use domain\Ticket\Ticket\Ticket;
- use domain\User\User\User;
- use domain\_\AbstractRepository;
-
- class TicketUserRepository extends AbstractRepository
- {
- protected TicketUserRepositoryQuery $query;
-
- public function loadDependencies(): void
- {
- $this->loadQuery(TicketUserRepositoryQuery::class);
- }
-
- /**
- * Retourne les options de base nécessaires à la fonction de recherche.
- */
- public function getDefaultOptionsSearch(): array
- {
- return [
- self::WITH => ['ticket', 'user'],
- self::JOIN_WITH => [],
- self::ORDER_BY => '',
- self::ATTRIBUTE_ID_PRODUCER => ''
- ];
- }
-
- public function findOneTicketUser(Ticket $ticket, User $user): ?TicketUser
- {
- return $this->createDefaultQuery()
- ->filterByTicket($ticket)
- ->filterByUser($user)
- ->findOne();
- }
- }
|