diff --git a/Base/Model.php b/Base/Model.php index 00ba8d8..fddd71f 100644 --- a/Base/Model.php +++ b/Base/Model.php @@ -445,7 +445,7 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, \ if (!$this->hasPrimary()) { return $this->refresh()->afterSave($this->_attributes, []); } - + $this->_attributes[$this->getPrimary()] = $lastId; return $this->refresh()->afterSave($this->_attributes, [$this->getPrimary() => $lastId]); @@ -658,6 +658,7 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, \ public function refresh(): static { $this->_oldAttributes = $this->_attributes; + $this->isNewExample = false; return $this; }