|
|
@@ -89,7 +89,6 @@ class AdminController extends EasyAdminController |
|
|
|
|
|
|
|
protected function commonQueryFilter($entityClass, $queryBuilder) |
|
|
|
{ |
|
|
|
|
|
|
|
if (new $entityClass instanceof FilterMultipleMerchantsInterface) { |
|
|
|
$queryBuilder->andWhere(':currentMerchant MEMBER OF entity.merchants') |
|
|
|
->setParameter(':currentMerchant', $this->getUser()->getMerchant()->getId()); |
|
|
@@ -287,9 +286,15 @@ class AdminController extends EasyAdminController |
|
|
|
$passedOptions = $child->getConfig()->getOptions(); |
|
|
|
$classImplements = class_implements($passedOptions['class']); |
|
|
|
|
|
|
|
if (in_array('Lc\ShopBundle\Context\FilterMerchantInterface', $classImplements)) { |
|
|
|
$isFilterMerchantInterface = in_array('Lc\ShopBundle\Context\FilterMerchantInterface', $classImplements) ; |
|
|
|
$isFilterMultipleMerchantsInterface = in_array('Lc\ShopBundle\Context\FilterMultipleMerchantsInterface', $classImplements) ; |
|
|
|
|
|
|
|
if ($isFilterMerchantInterface || $isFilterMultipleMerchantsInterface) { |
|
|
|
|
|
|
|
$propertyMerchant = 'merchant'; |
|
|
|
if($isFilterMultipleMerchantsInterface) { |
|
|
|
$propertyMerchant .= 's' ; |
|
|
|
} |
|
|
|
|
|
|
|
$form->add($child->getName(), EntityType::class, array( |
|
|
|
'class' => $this->em->getClassMetadata($passedOptions['class'])->getName(), |