|
|
@@ -212,8 +212,8 @@ class AdminController extends EasyAdminController |
|
|
|
if ($filter !== null) { |
|
|
|
if ($this->utils->hasFilterAssociation($field['initProperty'])) { |
|
|
|
$aliasRelation = $this->utils->getFilterAssociationAlias($field['initProperty']); |
|
|
|
if(array_search($aliasRelation, $queryBuilder->getAllAliases())===false){ |
|
|
|
$queryBuilder->innerJoin('entity.'.$aliasRelation, $aliasRelation); |
|
|
|
if (array_search($aliasRelation, $queryBuilder->getAllAliases()) === false) { |
|
|
|
$queryBuilder->innerJoin('entity.' . $aliasRelation, $aliasRelation); |
|
|
|
} |
|
|
|
$queryBuilder->andWhere($field['initProperty'] . ' LIKE :' . $field['property'] . ''); |
|
|
|
$queryBuilder->setParameter($field['property'], '%' . $filter . '%'); |
|
|
@@ -231,23 +231,20 @@ class AdminController extends EasyAdminController |
|
|
|
if ($filter !== null) { |
|
|
|
|
|
|
|
//TODO Faut généraliser avec TreeInterface, ça ne doit pas être ici |
|
|
|
if($field['property'] == 'productCategories') { |
|
|
|
if ($field['property'] == 'productCategories') { |
|
|
|
|
|
|
|
$queryBuilder->andWhere(':' . $field['property'] . ' MEMBER OF entity.' . $field['property'].' OR product_categories.parent = :' . $field['property']); |
|
|
|
$queryBuilder->andWhere(':' . $field['property'] . ' MEMBER OF entity.' . $field['property'] . ' OR product_categories.parent = :' . $field['property']); |
|
|
|
$queryBuilder->setParameter($field['property'], $filter); |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
if ($field['type_options']['multiple']) { |
|
|
|
$queryBuilder->andWhere(':' . $field['property'] . ' MEMBER OF entity.' . $field['property'] . ''); |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
$queryBuilder->andWhere('entity.' . $field['property'] . ' = :' . $field['property'] . ''); |
|
|
|
} |
|
|
|
|
|
|
|
if ($filter instanceof TreeInterface && $filter->getParent() == null) { |
|
|
|
$queryBuilder->setParameter($field['property'], array_merge(array($filter), $filter->getChildrens()->toArray())); |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
$queryBuilder->setParameter($field['property'], $filter); |
|
|
|
} |
|
|
|
} |
|
|
@@ -603,7 +600,8 @@ class AdminController extends EasyAdminController |
|
|
|
$isFilterMerchantInterface = in_array('Lc\ShopBundle\Context\FilterMerchantInterface', $classImplements); |
|
|
|
$isFilterMultipleMerchantsInterface = in_array('Lc\ShopBundle\Context\FilterMultipleMerchantsInterface', $classImplements); |
|
|
|
|
|
|
|
if ($isFilterMerchantInterface || $isFilterMultipleMerchantsInterface) { |
|
|
|
if (($isFilterMerchantInterface || $isFilterMultipleMerchantsInterface) && (!isset($passedOptions['merchant_filter']) || $passedOptions['merchant_filter'] === true)) { |
|
|
|
|
|
|
|
|
|
|
|
if (in_array('Lc\ShopBundle\Context\StatusInterface', $classImplements)) { |
|
|
|
$statusInterface = true; |