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.

35 lines
950B

  1. <?php
  2. namespace domain\PointSale\SharedPointSale;
  3. use domain\_\AbstractRepositoryQuery;
  4. use domain\_\StatusInterface;
  5. use domain\Producer\Producer\Producer;
  6. class SharedPointSaleRepositoryQuery extends AbstractRepositoryQuery
  7. {
  8. protected SharedPointSaleDefinition $sharedPointSaleDefinition;
  9. public function loadDependencies(): void
  10. {
  11. $this->loadDefinition(SharedPointSaleDefinition::class);
  12. }
  13. public function filterIsStatusOnline()
  14. {
  15. $this->andWhere(['shared_point_sale.status' => StatusInterface::STATUS_ONLINE]);
  16. return $this;
  17. }
  18. public function filterByProducerOfPointSale(Producer $producer): self
  19. {
  20. $this->andWhere(['point_sale.id_producer' => $producer->id]);
  21. return $this;
  22. }
  23. public function filterByProducerWithSharing(Producer $producer): self
  24. {
  25. $this->andWhere(['id_producer_with_sharing' => $producer->id]);
  26. return $this;
  27. }
  28. }