|
|
|
|
|
|
|
|
$filter = $this->getListFilterParam($field['property']); |
|
|
$filter = $this->getListFilterParam($field['property']); |
|
|
//$filter = $this->filtersForm->get($field['property'])->getData(); |
|
|
//$filter = $this->filtersForm->get($field['property'])->getData(); |
|
|
if ($filter !== null) { |
|
|
if ($filter !== null) { |
|
|
if ($field['type_options']['multiple']) { |
|
|
|
|
|
$queryBuilder->andWhere(':' . $field['property'] . ' MEMBER OF entity.' . $field['property'] . ''); |
|
|
|
|
|
} 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 { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TODO Faut généraliser avec TreeInterface, ça ne doit pas être ici |
|
|
|
|
|
if($field['property'] == 'productCategories') { |
|
|
|
|
|
|
|
|
|
|
|
$queryBuilder->andWhere(':' . $field['property'] . ' MEMBER OF entity.' . $field['property'].' OR product_categories.parent = :' . $field['property']); |
|
|
$queryBuilder->setParameter($field['property'], $filter); |
|
|
$queryBuilder->setParameter($field['property'], $filter); |
|
|
} |
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
if ($field['type_options']['multiple']) { |
|
|
|
|
|
$queryBuilder->andWhere(':' . $field['property'] . ' MEMBER OF entity.' . $field['property'] . ''); |
|
|
|
|
|
} |
|
|
|
|
|
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 { |
|
|
|
|
|
$queryBuilder->setParameter($field['property'], $filter); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
case 'datetime': |
|
|
case 'datetime': |