您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

TicketUserRepositoryQuery.php 684B

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