mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-14 19:18:41 +00:00
fix datamapper null value for obj
This commit is contained in:
parent
3afc442cf0
commit
c608caa0e2
|
|
@ -1765,7 +1765,10 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
}
|
||||
|
||||
if (in_array(static::$columns[$column]['type'], ['string', 'int', 'float', 'bool'])) {
|
||||
settype($value, static::$columns[$column]['type']);
|
||||
if($reflectionProperty->getValue($obj) !== null) {
|
||||
settype($value, static::$columns[$column]['type']);
|
||||
}
|
||||
|
||||
$reflectionProperty->setValue($obj, $value);
|
||||
} elseif (static::$columns[$column]['type'] === 'DateTime') {
|
||||
$reflectionProperty->setValue($obj, new \DateTime($value ?? ''));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user