Skip to content

Commit

Permalink
DDC-3065 - applying hotfix that allows NULL in IN() criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Apr 3, 2014
1 parent a8b9680 commit 733102b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/Doctrine/ORM/Persisters/BasicEntityPersister.php
Expand Up @@ -1534,7 +1534,13 @@ public function getSelectConditionStatementSQL($field, $value, $assoc = null, $c
}

if (is_array($value)) {
return sprintf('%s IN (%s)' , $condition, $placeholder);
$in = sprintf('%s IN (%s)' , $condition, $placeholder);

if (false !== array_search(null, $value, true)) {
return sprintf('(%s OR %s IS NULL)' , $in, $condition);
}

return $in;
}

if ($value === null) {
Expand Down

0 comments on commit 733102b

Please sign in to comment.