|
12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
-
- namespace domain\Communication\AutomaticEmail;
-
- use domain\_\AbstractRepository;
- use domain\_\RepositoryQueryInterface;
-
- class AutomaticEmailRepository extends AbstractRepository
- {
- protected AutomaticEmailRepositoryQuery $query;
-
- public function loadDependencies(): void
- {
- $this->loadQuery(AutomaticEmailRepositoryQuery::class);
- }
-
- public function getDefaultOptionsSearch(): array
- {
- return [
- self::WITH => [],
- self::JOIN_WITH => [],
- self::ORDER_BY => 'day ASC',
- self::ATTRIBUTE_ID_PRODUCER => 'automatic_email.id_producer'
- ];
- }
-
- public function findOneAutomaticEmailById(int $id): ?AutomaticEmail
- {
- return $this->createDefaultQuery()
- ->filterById($id)
- ->findOne();
- }
-
- public function queryAutomaticEmails(): RepositoryQueryInterface
- {
- return $this->createDefaultQuery();
- }
-
- public function findAutomaticEmails(): array
- {
- return $this->queryAutomaticEmails()->find();
- }
- }
|