You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
794B

  1. <?php
  2. namespace common\logic\Ticket\TicketUser\Repository;
  3. use common\logic\AbstractRepositoryQuery;
  4. use common\logic\Ticket\Ticket\Model\Ticket;
  5. use common\logic\Ticket\TicketUser\Service\TicketUserDefinition;
  6. use common\logic\User\User\Model\User;
  7. class TicketUserRepositoryQuery extends AbstractRepositoryQuery
  8. {
  9. protected TicketUserDefinition $definition;
  10. public function loadDependencies(): void
  11. {
  12. $this->loadDefinition(TicketUserDefinition::class);
  13. }
  14. public function filterByTicket(Ticket $ticket): self
  15. {
  16. $this->andWhere(['ticket_user.id_ticket' => $ticket->id]);
  17. return $this;
  18. }
  19. public function filterByUser(User $user): self
  20. {
  21. $this->andWhere(['ticket_user.id_user' => $user->id]);
  22. return $this;
  23. }
  24. }