This commit is contained in:
2021-11-11 03:14:52 +08:00
parent 07a40f4449
commit c13d4101b9
3 changed files with 8 additions and 4 deletions
+6 -2
View File
@@ -512,7 +512,9 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
if (empty($param)) {
return $this;
}
$this->_attributes = $param;
foreach ($this->_attributes as $key => $attribute) {
$this->_attributes[$key] = $this->_setter($key, $attribute);
}
return $this;
}
@@ -525,7 +527,9 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
if (empty($param) || !is_array($param)) {
return $this;
}
$this->_oldAttributes = $param;
foreach ($this->_oldAttributes as $key => $attribute) {
$this->_oldAttributes[$key] = $this->_setter($key, $attribute);
}
return $this;
}