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.

33 lines
963B

  1. <?php
  2. namespace common\logic\Distribution\PointSaleDistribution\Repository;
  3. use common\logic\AbstractRepositoryQuery;
  4. use common\logic\Distribution\Distribution\Model\Distribution;
  5. use common\logic\Distribution\PointSaleDistribution\Service\PointSaleDistributionDefinition;
  6. use common\logic\PointSale\PointSale\Model\PointSale;
  7. use yii\db\ActiveQuery;
  8. class PointSaleDistributionRepositoryQuery extends AbstractRepositoryQuery
  9. {
  10. protected PointSaleDistributionDefinition $definition;
  11. public function loadDependencies(): void
  12. {
  13. $this->loadDefinition(PointSaleDistributionDefinition::class);
  14. }
  15. public function filterByDistribution(Distribution $distribution): self
  16. {
  17. $this->andWhere(['id_distribution' => $distribution->id]);
  18. return $this;
  19. }
  20. public function filterByPointSale(PointSale $pointSale): self
  21. {
  22. $this->andWhere(['id_point_sale' => $pointSale->id]);
  23. return $this;
  24. }
  25. }