Skip to content

Commit

Permalink
Merge pull request Sylius#1487 from aRn0D/fix/criteria
Browse files Browse the repository at this point in the history
[ResourBundle] The criteria don't care about empties values
  • Loading branch information
Paweł Jędrzejewski committed May 14, 2014
2 parents fbc69dd + fc6b5a1 commit 37871d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Doctrine/ORM/EntityRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,12 @@ protected function applyCriteria(QueryBuilder $queryBuilder, array $criteria = n
if (null === $value) {
$queryBuilder
->andWhere($queryBuilder->expr()->isNull($this->getPropertyName($property)));
} elseif (!is_array($value)) {
} elseif (is_array($value)) {
$queryBuilder->andWhere($queryBuilder->expr()->in($this->getPropertyName($property), $value));
} elseif ('' !== $value) {
$queryBuilder
->andWhere($queryBuilder->expr()->eq($this->getPropertyName($property), ':' . $property))
->setParameter($property, $value);
} else {
$queryBuilder->andWhere($queryBuilder->expr()->in($this->getPropertyName($property), $value));
}
}
}
Expand Down

0 comments on commit 37871d3

Please sign in to comment.