|
- <?php
-
- namespace Lc\CaracoleBundle\Repository\User;
-
- use App\Entity\Newsletter\Newsletter;
- use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
- use Lc\SovBundle\Repository\User\UserStore as SovUserStore;
-
- class UserStore extends SovUserStore
- {
- use MerchantStoreTrait;
-
- public function getByNewsletter(Newsletter $newsletter, $query = null): array
- {
- if (is_null($query)) {
- $query = $this->query->create();
- }
-
- if ($this->merchant) {
- $query
- ->filterByJoinUserMerchant($this->merchant)
- ->filterMerchantIsActive();
- }
-
- return parent::getByNewsletter($newsletter, $query);
- }
- }
|