選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

AutomaticEmailRepository.php 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace domain\Communication\AutomaticEmail;
  3. use domain\_\AbstractRepository;
  4. use domain\_\RepositoryQueryInterface;
  5. class AutomaticEmailRepository extends AbstractRepository
  6. {
  7. protected AutomaticEmailRepositoryQuery $query;
  8. public function loadDependencies(): void
  9. {
  10. $this->loadQuery(AutomaticEmailRepositoryQuery::class);
  11. }
  12. public function getDefaultOptionsSearch(): array
  13. {
  14. return [
  15. self::WITH => [],
  16. self::JOIN_WITH => [],
  17. self::ORDER_BY => 'day ASC',
  18. self::ATTRIBUTE_ID_PRODUCER => 'automatic_email.id_producer'
  19. ];
  20. }
  21. public function findOneAutomaticEmailById(int $id): ?AutomaticEmail
  22. {
  23. return $this->createDefaultQuery()
  24. ->filterById($id)
  25. ->findOne();
  26. }
  27. public function queryAutomaticEmails(): RepositoryQueryInterface
  28. {
  29. return $this->createDefaultQuery();
  30. }
  31. public function findAutomaticEmails(): array
  32. {
  33. return $this->queryAutomaticEmails()->find();
  34. }
  35. }