From e2f2968537e766d5a58702e15933c6aa1a5d63f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?p=C3=A9c=C3=A9?= Date: Fri, 13 Nov 2020 16:33:17 +0100 Subject: [PATCH] Fix Mongo form filters --- .../MongoOdmPostQueryBuilderSubscriber.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/EventListener/MongoOdmPostQueryBuilderSubscriber.php b/src/EventListener/MongoOdmPostQueryBuilderSubscriber.php index fbc1c406..ca0b1764 100644 --- a/src/EventListener/MongoOdmPostQueryBuilderSubscriber.php +++ b/src/EventListener/MongoOdmPostQueryBuilderSubscriber.php @@ -59,33 +59,33 @@ protected function filterQueryBuilder(QueryBuilder $queryBuilder, string $field, switch ($operator) { case ListFilter::OPERATOR_EQUALS: if ('_NULL' === $value) { - $filterExpr = $queryBuilder->expr()->field($field)->equals(null); + $filterExpr = $queryBuilder->expr()->field($queryField)->equals(null); } elseif ('_NOT_NULL' === $value) { - $filterExpr = $queryBuilder->expr()->field($field)->notEqual(null); + $filterExpr = $queryBuilder->expr()->field($queryField)->notEqual(null); } else { - $filterExpr = $queryBuilder->expr()->field($field)->equals($value); + $filterExpr = $queryBuilder->expr()->field($queryField)->equals($value); } break; case ListFilter::OPERATOR_NOT: - $filterExpr = $queryBuilder->expr()->field($field)->not($value); + $filterExpr = $queryBuilder->expr()->field($queryField)->not($value); break; case ListFilter::OPERATOR_IN: // Checks that $value is not an empty Traversable if (0 < \count($value)) { - $filterExpr = $queryBuilder->expr()->field($field)->in($value); + $filterExpr = $queryBuilder->expr()->field($queryField)->in($value); } break; case ListFilter::OPERATOR_GT: - $filterExpr = $queryBuilder->expr()->field($field)->gt($value); + $filterExpr = $queryBuilder->expr()->field($queryField)->gt($value); break; case ListFilter::OPERATOR_GTE: - $filterExpr = $queryBuilder->expr()->field($field)->gte($value); + $filterExpr = $queryBuilder->expr()->field($queryField)->gte($value); break; case ListFilter::OPERATOR_LT: - $filterExpr = $queryBuilder->expr()->field($field)->lt($value); + $filterExpr = $queryBuilder->expr()->field($queryField)->lt($value); break; case ListFilter::OPERATOR_LTE: - $filterExpr = $queryBuilder->expr()->field($field)->lte($value); + $filterExpr = $queryBuilder->expr()->field($queryField)->lte($value); break; case ListFilter::OPERATOR_NOTIN: