mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-07 04:58:40 +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'])) {
|
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);
|
$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 ?? ''));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user