You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DistributionRotatingRepositoryQuery.php 886B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace domain\Distribution\DistributionRotating;
  3. use domain\_\AbstractRepositoryQuery;
  4. use domain\Distribution\Distribution\Distribution;
  5. use domain\Product\Rotating\Rotating;
  6. use domain\Product\RotatingProduct\RotatingProduct;
  7. class DistributionRotatingRepositoryQuery extends AbstractRepositoryQuery
  8. {
  9. protected DistributionRotatingDefinition $definition;
  10. public function loadDependencies(): void
  11. {
  12. $this->loadDefinition(DistributionRotatingDefinition::class);
  13. }
  14. public function filterByDistribution(Distribution $distribution): self
  15. {
  16. $this->andWhere(['distribution_rotating.id_distribution' => $distribution->id]);
  17. return $this;
  18. }
  19. public function filterByRotating(Rotating $rotating): self
  20. {
  21. $this->andWhere(['distribution_rotating.id_rotating' => $rotating->getId()]);
  22. return $this;
  23. }
  24. }