No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

34 líneas
844B

  1. <?php
  2. namespace Lc\CaracoleBundle\Repository;
  3. use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
  4. use Lc\CaracoleBundle\Model\Section\SectionInterface;
  5. trait SectionRepositoryQueryTrait
  6. {
  7. protected bool $isJoinSection = false;
  8. public function filterBySection(SectionInterface $section)
  9. {
  10. return $this->andWhereSection($this->id, $section);
  11. }
  12. public function filterByMerchantViaSection(MerchantInterface $merchant)
  13. {
  14. $this->joinSection();
  15. return $this->andWhere('s.merchant = :merchant')
  16. ->setParameter('merchant', $merchant);
  17. }
  18. public function joinSection(): self
  19. {
  20. if (!$this->isJoinSection) {
  21. $this->isJoinSection = true;
  22. return $this
  23. ->leftJoin('.section', 's');
  24. }
  25. return $this;
  26. }
  27. }