Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

36 lines
936B

  1. <?php
  2. namespace Lc\CaracoleBundle\Repository\Reduction;
  3. use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
  4. use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface;
  5. use Lc\CaracoleBundle\Model\Reduction\ReductionCreditModel;
  6. use Lc\CaracoleBundle\Repository\Order\OrderShopStore;
  7. use Lc\SovBundle\Model\User\UserInterface;
  8. use Lc\SovBundle\Repository\AbstractStore;
  9. class ReductionCreditStore extends AbstractStore
  10. {
  11. protected ReductionCreditRepositoryQuery $query;
  12. public function __construct(
  13. ReductionCreditRepositoryQuery $query
  14. ) {
  15. $this->query = $query;
  16. }
  17. // findReductionCreditsByUser
  18. public function getByTypeAndUser(string $type = ReductionCreditModel::TYPE_CREDIT, UserInterface $user)
  19. {
  20. $query = $this->query->create();
  21. $query
  22. ->filterByType($type)
  23. ->filterByUser($user);
  24. return $query->find();
  25. }
  26. }