Fix data type bug

This commit is contained in:
Dennis Eichhorn 2017-01-29 19:10:10 +01:00
parent 7a42559deb
commit a4e89ee7b1

View File

@ -972,7 +972,7 @@ class DataMapperAbstract implements DataMapperInterface
settype($value, static::$columns[$column]['type']); settype($value, static::$columns[$column]['type']);
$reflectionProperty->setValue($obj, $value); $reflectionProperty->setValue($obj, $value);
} elseif (static::$columns[$column]['type'] === 'DateTime') { } elseif (static::$columns[$column]['type'] === 'DateTime') {
$reflectionProperty->setValue($obj, new \DateTime($value)); $reflectionProperty->setValue($obj, new \DateTime($value ?? ''));
} elseif (static::$columns[$column]['type'] === 'Json') { } elseif (static::$columns[$column]['type'] === 'Json') {
$reflectionProperty->setValue($obj, json_decode($value, true)); $reflectionProperty->setValue($obj, json_decode($value, true));
} elseif (static::$columns[$column]['type'] === 'Serializable') { } elseif (static::$columns[$column]['type'] === 'Serializable') {