Skip to content

Commit

Permalink
The criteria don't care about empties values
Browse files Browse the repository at this point in the history
  • Loading branch information
arnolanglade committed May 12, 2014
1 parent 8a1f7c1 commit fc6b5a1
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 fc6b5a1

Please sign in to comment.