您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ProductPriceRepositoryQuery.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace domain\Product\ProductPrice\Repository;
  3. use domain\PointSale\PointSale\PointSale;
  4. use domain\Product\Product\Product;
  5. use domain\Product\ProductPrice\Service\ProductPriceDefinition;
  6. use domain\User\User\User;
  7. use domain\User\UserGroup\UserGroup;
  8. use domain\_\AbstractRepositoryQuery;
  9. class ProductPriceRepositoryQuery extends AbstractRepositoryQuery
  10. {
  11. protected ProductPriceDefinition $definition;
  12. public function loadDependencies(): void
  13. {
  14. $this->loadDefinition(ProductPriceDefinition::class);
  15. }
  16. public function filterByProduct(Product $product): self
  17. {
  18. $this->andWhere(['id_product' => $product->id]);
  19. return $this;
  20. }
  21. public function filterByUser(User $user): self
  22. {
  23. $this->andWhere(['id_user' => $user->id]);
  24. return $this;
  25. }
  26. public function filterByUserGroup(UserGroup $userGroup): self
  27. {
  28. $this->andWhere(['id_user_group' => $userGroup->id]);
  29. return $this;
  30. }
  31. public function filterByPointSale(PointSale $pointSale): self
  32. {
  33. $this->andWhere(['id_point_sale' => $pointSale->id]);
  34. return $this;
  35. }
  36. public function filterByFromQuantity(float $fromQuantity): self
  37. {
  38. $this->andWhere(['from_quantity' => $fromQuantity]);
  39. return $this;
  40. }
  41. }