|
- <?php
-
- namespace domain\Product\Rotating;
-
- use domain\_\AbstractRepository;
- use domain\_\RepositoryQueryInterface;
-
- class RotatingRepository extends AbstractRepository
- {
- protected RotatingRepositoryQuery $query;
-
- public function loadDependencies(): void
- {
- $this->loadQuery(RotatingRepositoryQuery::class);
- }
-
- public function getDefaultOptionsSearch(): array
- {
- return [
- self::WITH => [],
- self::JOIN_WITH => [],
- self::ORDER_BY => 'rotating.day ASC',
- self::ATTRIBUTE_ID_PRODUCER => 'rotating.id_producer'
- ];
- }
-
- public function queryRotatings(): RepositoryQueryInterface
- {
- return $this->createDefaultQuery();
- }
-
- public function findOneRotatingById(int $id): ?Rotating
- {
- return $this->createDefaultQuery()
- ->filterById($id)
- ->findOne();
- }
- }
|