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.

56 lines
1.5KB

  1. <?php
  2. namespace Lc\CaracoleBundle\Repository\Site;
  3. use Lc\CaracoleBundle\Model\Section\SectionInterface;
  4. use Lc\CaracoleBundle\Repository\SectionStoreTrait;
  5. use Lc\SovBundle\Model\Site\PageInterface;
  6. use Lc\SovBundle\Repository\Site\PageStore as SovPageStore;
  7. class PageStore extends SovPageStore
  8. {
  9. use SectionStoreTrait;
  10. public function __construct(PageRepositoryQuery $query)
  11. {
  12. parent::__construct($query);
  13. }
  14. // findPage
  15. public function getOnePage(string $devAlias): ?PageInterface
  16. {
  17. $query = $this->query->create();
  18. $query
  19. ->filterIsOnline()
  20. ->filterByDevAlias($devAlias)
  21. ->filterBySection($this->section);
  22. return $query->findOne();
  23. }
  24. // public function findPage($devAlias, $devAliasMerchant = false)
  25. // {
  26. // $merchant = false;
  27. //
  28. // if ($devAliasMerchant) {
  29. // $merchant = $this->merchantUtils->getMerchantByDevAlias($devAliasMerchant);
  30. // }
  31. //
  32. // if ($devAliasMerchant && $merchant) {
  33. // $query = $this->createQueryBuilder('e')
  34. // ->where('e.merchant = :merchant')
  35. // ->setParameter('merchant', $merchant->getId());
  36. // } else {
  37. // $query = $this->findByMerchantQuery();
  38. // }
  39. //
  40. // return $query->andWhere('e.status = 1')
  41. // ->andWhere('e.devAlias = :devAlias')
  42. // ->setParameter('devAlias', $devAlias)
  43. // ->getQuery()
  44. // ->getOneOrNullResult();
  45. // }
  46. }