Skip to content
Browse files

Ignore invalid null values

  • Loading branch information...
1 parent 49507b4 commit fffbb6a24ba34221d6ceed31de70d88de1dfe1f1 @davidwindell davidwindell committed Jan 16, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/DoctrineModule/Stdlib/Hydrator/DoctrineObject.php
View
4 src/DoctrineModule/Stdlib/Hydrator/DoctrineObject.php
@@ -235,7 +235,9 @@ protected function hydrateByValue(array $data, $object)
$value = $this->hydrateValue($field, $value);
- if (null !== $value || !current($metadata->getReflectionClass()->getMethod($setter)->getParameters())->allowsNull()) {
+ if (null === $value && !current($metadata->getReflectionClass()->getMethod($setter)->getParameters())->allowsNull()) {
+ continue;
+ } elseif (null !== $value) {
$value = $this->toOne($target, $value);
}

0 comments on commit fffbb6a

Please sign in to comment.
Something went wrong with that request. Please try again.