|
- <?php
-
- namespace domain\Distribution\DistributionRotating;
-
- use domain\_\AbstractRepository;
- use domain\Distribution\Distribution\Distribution;
- use domain\Product\Rotating\Rotating;
- use domain\Product\RotatingProduct\RotatingProduct;
-
- class DistributionRotatingRepository extends AbstractRepository
- {
- protected DistributionRotatingRepositoryQuery $query;
-
- public function loadDependencies(): void
- {
- $this->loadQuery(DistributionRotatingRepositoryQuery::class);
- }
-
- public function getDefaultOptionsSearch(): array
- {
- return [
- self::WITH => [],
- self::JOIN_WITH => ['rotatingRelation'],
- self::ORDER_BY => 'rotating.name ASC',
- self::ATTRIBUTE_ID_PRODUCER => ''
- ];
- }
-
- public function findOneDistributionRotating(Distribution $distribution, Rotating $rotating): ?DistributionRotating
- {
- return $this->createQuery()
- ->filterByDistribution($distribution)
- ->filterByRotating($rotating)
- ->findOne();
- }
- }
|