Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

UserPointSaleRepositoryQuery.php 842B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace domain\PointSale\UserPointSale;
  3. use domain\PointSale\PointSale\PointSale;
  4. use domain\User\User\User;
  5. use domain\_\AbstractRepositoryQuery;
  6. class UserPointSaleRepositoryQuery extends AbstractRepositoryQuery
  7. {
  8. protected UserPointSaleDefinition $definition;
  9. public function loadDependencies(): void
  10. {
  11. $this->loadDefinition(UserPointSaleDefinition::class);
  12. }
  13. public function joinPointSale(): self
  14. {
  15. $this->innerJoinWith('pointSale', true);
  16. return $this;
  17. }
  18. public function filterByUser(User $user): self
  19. {
  20. $this->andWhere(['user_point_sale.id_user' => $user->id]);
  21. return $this;
  22. }
  23. public function filterByPointSale(PointSale $pointSale): self
  24. {
  25. $this->andWhere(['id_point_sale' => $pointSale->id]);
  26. return $this;
  27. }
  28. }