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

40 行
989B

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