Browse Source

filter

feature/symfony6.1
Charly 2 years ago
parent
commit
ba3e33b0ea
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      Field/Filter/AssociationFilter.php

+ 2
- 2
Field/Filter/AssociationFilter.php View File

public function applyFilter(RepositoryQueryInterface $repositoryQuery, FieldDto $fieldDto, $filteredValue = null) public function applyFilter(RepositoryQueryInterface $repositoryQuery, FieldDto $fieldDto, $filteredValue = null)
{ {
$fieldProperty = $this->getFieldProperty($fieldDto); $fieldProperty = $this->getFieldProperty($fieldDto);
if ($filteredValue !== null) {


if ($fieldDto->getFormTypeOption('multiple')) {
if ($filteredValue !== null) {
if ($fieldDto->getFormTypeOption('multiple') || ($fieldDto->getTemplatePath() != null && str_contains($fieldDto->getTemplatePath(), 'association_many'))) {
$repositoryQuery->andWhere(':' . $fieldProperty . ' MEMBER OF .' . $fieldProperty . ''); $repositoryQuery->andWhere(':' . $fieldProperty . ' MEMBER OF .' . $fieldProperty . '');
} else { } else {
$repositoryQuery->andWhere('.' . $fieldProperty . ' = :' . $fieldProperty . ''); $repositoryQuery->andWhere('.' . $fieldProperty . ' = :' . $fieldProperty . '');

Loading…
Cancel
Save