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.
|
- <?php
-
- namespace Lc\CaracoleBundle\Repository\Newsletter;
-
- use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
- use Lc\CaracoleBundle\Repository\SectionStoreTrait;
- use Lc\CaracoleBundle\Repository\StoreTrait;
- use Lc\SovBundle\Repository\Newsletter\NewsletterStore as SovNewsletterStore;
- use Lc\SovBundle\Repository\RepositoryQueryInterface;
-
- class NewsletterStore extends SovNewsletterStore
- {
- use StoreTrait;
- use SectionStoreTrait;
-
- public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
- {
- $query->orderBy('position');
- return $query;
- }
-
- public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
- {
- $this->addFilterBySectionOptionnal($query);
- $query->filterIsOnlineAndOffline();
- return $query;
- }
-
- public function relationsDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
- {
- return $query;
- }
-
- public function getByMerchant(MerchantInterface $merchant, RepositoryQueryInterface $query = null):array
- {
- $query = $this->createQuery($query);
- $query->filterByMerchantViaSection($merchant);
- return $query->find();
- }
- }
|