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.

PointSaleDistributionRepositoryQuery.php 963B

123456789101112131415161718192021222324252627282930313233
  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. }