|
|
@@ -6,6 +6,7 @@ use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; |
|
|
|
use Lc\CaracoleBundle\Model\Section\SectionInterface; |
|
|
|
use Lc\CaracoleBundle\Repository\MerchantStoreTrait; |
|
|
|
use Lc\CaracoleBundle\Repository\SectionStoreTrait; |
|
|
|
use Lc\SovBundle\Model\User\UserInterface; |
|
|
|
use Lc\SovBundle\Repository\Reminder\ReminderStore as SovReminderStore; |
|
|
|
|
|
|
|
class ReminderStore extends SovReminderStore |
|
|
@@ -15,19 +16,49 @@ class ReminderStore extends SovReminderStore |
|
|
|
|
|
|
|
public function get($params = [], $query = null) |
|
|
|
{ |
|
|
|
if(is_null($query)) { |
|
|
|
if (is_null($query)) { |
|
|
|
$query = $this->query->create(); |
|
|
|
} |
|
|
|
|
|
|
|
if($this->merchant) { |
|
|
|
if ($this->merchant) { |
|
|
|
$query->filterByMerchant($this->merchant); |
|
|
|
} |
|
|
|
|
|
|
|
if($this->section) { |
|
|
|
if ($this->section) { |
|
|
|
$query->filterBySection($this->section); |
|
|
|
} |
|
|
|
|
|
|
|
return parent::get($params, $query); |
|
|
|
} |
|
|
|
|
|
|
|
public function getByUser(UserInterface $user, $query = null): array |
|
|
|
{ |
|
|
|
if (is_null($query)) { |
|
|
|
$query = $this->query->create(); |
|
|
|
} |
|
|
|
|
|
|
|
if ($this->merchant) { |
|
|
|
$query->filterByMerchant($this->merchant); |
|
|
|
} |
|
|
|
|
|
|
|
return parent::getByUser($user, $query); |
|
|
|
} |
|
|
|
|
|
|
|
public function getByEasyAdminConfigAndUser( |
|
|
|
string $crudAction, |
|
|
|
string $crudControllerFqcn, |
|
|
|
UserInterface $user, |
|
|
|
int $entityId = null, |
|
|
|
$query = null |
|
|
|
): array { |
|
|
|
if (is_null($query)) { |
|
|
|
$query = $this->query->create(); |
|
|
|
} |
|
|
|
|
|
|
|
if ($this->merchant) { |
|
|
|
$query->filterByMerchant($this->merchant); |
|
|
|
} |
|
|
|
|
|
|
|
return parent::getByEasyAdminConfigAndUser($crudAction, $crudControllerFqcn, $user, $entityId, $query); |
|
|
|
} |
|
|
|
} |