Fix error on getVars when get not set properties.

This commit is contained in:
kj 2022-04-05 17:12:30 -04:00
parent 9689ac82cf
commit a23e795f5c

View File

@ -196,7 +196,8 @@ class ModelMySQL {
foreach($properties as $property) { foreach($properties as $property) {
$att = $property->name; $att = $property->name;
$result[$att] = $this->$att; $result[$att] = isset($this->$att)
? $this->$att : null;
} }
foreach (static::$ignoreSave as $del) { foreach (static::$ignoreSave as $del) {
@ -204,7 +205,8 @@ class ModelMySQL {
} }
foreach (static::$forceSave as $value) { foreach (static::$forceSave as $value) {
$result[$value] = $this->$value; $result[$value] = isset($this->$value)
? $this->$value: null;
} }
return $result; return $result;