Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

NewsletterStore.php 1.3KB

il y a 3 ans
il y a 3 ans
il y a 3 ans
il y a 3 ans
il y a 3 ans
il y a 3 ans
il y a 3 ans
12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace Lc\CaracoleBundle\Repository\Newsletter;
  3. use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
  4. use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
  5. use Lc\CaracoleBundle\Repository\SectionStoreTrait;
  6. use Lc\CaracoleBundle\Repository\StoreTrait;
  7. use Lc\SovBundle\Repository\Newsletter\NewsletterStore as SovNewsletterStore;
  8. use Lc\SovBundle\Repository\RepositoryQueryInterface;
  9. class NewsletterStore extends SovNewsletterStore
  10. {
  11. use StoreTrait;
  12. use SectionStoreTrait;
  13. use MerchantStoreTrait;
  14. public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
  15. {
  16. $query->orderBy('position');
  17. return $query;
  18. }
  19. public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
  20. {
  21. $this->addFilterBySectionOptionnal($query);
  22. $this->addFilterByMerchantViaSectionOptionnal($query);
  23. $query->filterIsOnlineAndOffline();
  24. return $query;
  25. }
  26. public function relationsDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
  27. {
  28. return $query;
  29. }
  30. public function getByMerchant(MerchantInterface $merchant, RepositoryQueryInterface $query = null):array
  31. {
  32. $query = $this->createQuery($query);
  33. $query->filterByMerchantViaSection($merchant);
  34. return $query->find();
  35. }
  36. }