Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

44 lines
1.2KB

  1. <?php
  2. namespace Lc\CaracoleBundle\Repository\PointSale;
  3. use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface;
  4. use Lc\CaracoleBundle\Repository\AbstractStore;
  5. use Lc\CaracoleBundle\Repository\SectionStoreTrait;
  6. use Lc\SovBundle\Repository\RepositoryQueryInterface;
  7. class PointSaleSectionStore extends AbstractStore
  8. {
  9. use SectionStoreTrait;
  10. protected PointSaleSectionRepositoryQuery $query;
  11. public function __construct(PointSaleSectionRepositoryQuery $query)
  12. {
  13. $this->query = $query;
  14. }
  15. public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
  16. {
  17. return $query;
  18. }
  19. public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
  20. {
  21. $this->addFilterBySectionOptionnal($query);
  22. return $query;
  23. }
  24. public function relationsDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
  25. {
  26. return $query;
  27. }
  28. public function getOneByPointSale(PointSaleInterface $pointSale, $query = null)
  29. {
  30. $query = $this->createDefaultQuery($query);
  31. $query->filterByPointSale($pointSale);
  32. return $query->findOne();
  33. }
  34. }