diff --git a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php index 6504a3ee0..6fc1f9966 100644 --- a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php @@ -1534,7 +1534,13 @@ class BasicEntityPersister implements EntityPersister } 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) {