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.

27 lines
677B

  1. <?php
  2. namespace Lc\CaracoleBundle\Repository\Reduction;
  3. use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface;
  4. use Lc\SovBundle\Repository\AbstractStore;
  5. class ReductionCatalogStore extends AbstractStore
  6. {
  7. protected ReductionCatalogRepositoryQuery $query;
  8. public function __construct(ReductionCatalogRepositoryQuery $query)
  9. {
  10. $this->query = $query;
  11. }
  12. public function getByProductFamily(ProductFamilyInterface $productFamily, $query = null)
  13. {
  14. $query = $this->createQuery($query);
  15. $query
  16. ->filterProductFamily($productFamily)
  17. ->filterIsOnline();
  18. return $query->findOne();
  19. }
  20. }