|
|
@@ -3,6 +3,7 @@ |
|
|
|
namespace Lc\ShopBundle\Controller\Admin; |
|
|
|
|
|
|
|
use EasyCorp\Bundle\EasyAdminBundle\Controller\EasyAdminController; |
|
|
|
use EasyCorp\Bundle\EasyAdminBundle\Event\EasyAdminEvents; |
|
|
|
use Lc\ShopBundle\Context\MerchantInterface; |
|
|
|
use Symfony\Component\Security\Core\Security; |
|
|
|
|
|
|
@@ -15,6 +16,16 @@ class AdminController extends EasyAdminController |
|
|
|
$this->security = $security; |
|
|
|
} |
|
|
|
|
|
|
|
protected function createListQueryBuilder($entityClass, $sortDirection, $sortField = null, $dqlFilter = null) |
|
|
|
{ |
|
|
|
if ($pos = strpos($dqlFilter, 'currentMerchant')) { |
|
|
|
$dqlFilter = sprintf(str_replace('currentMerchant', $this->getUser()->getMerchant()->getId(), $dqlFilter)); |
|
|
|
} |
|
|
|
|
|
|
|
return parent::createListQueryBuilder($entityClass, $sortDirection, $sortField, $dqlFilter); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function renderTemplate($actionName, $templatePath, array $parameters = []) |
|
|
|
{ |
|
|
|
$parameters = array_merge( |