Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

TicketUserRepository.php 942B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace domain\Ticket\TicketUser;
  3. use domain\Ticket\Ticket\Ticket;
  4. use domain\User\User\User;
  5. use domain\_\AbstractRepository;
  6. class TicketUserRepository extends AbstractRepository
  7. {
  8. protected TicketUserRepositoryQuery $query;
  9. public function loadDependencies(): void
  10. {
  11. $this->loadQuery(TicketUserRepositoryQuery::class);
  12. }
  13. /**
  14. * Retourne les options de base nécessaires à la fonction de recherche.
  15. */
  16. public function getDefaultOptionsSearch(): array
  17. {
  18. return [
  19. self::WITH => ['ticket', 'user'],
  20. self::JOIN_WITH => [],
  21. self::ORDER_BY => '',
  22. self::ATTRIBUTE_ID_PRODUCER => ''
  23. ];
  24. }
  25. public function findOneTicketUser(Ticket $ticket, User $user): ?TicketUser
  26. {
  27. return $this->createDefaultQuery()
  28. ->filterByTicket($ticket)
  29. ->filterByUser($user)
  30. ->findOne();
  31. }
  32. }