Skip to content

Commit cb3d496

Browse files
committed
Fix reset write properties process
1 parent b738a6a commit cb3d496

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Model.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Base Model
99
*
1010
* @author Nick Tsai <[email protected]>
11-
* @version 2.17.0
11+
* @version 2.17.1
1212
* @see https://github.com/yidas/codeigniter-model
1313
*/
1414
class Model extends \CI_Model implements \ArrayAccess
@@ -1071,6 +1071,8 @@ public function save($runValidation=true)
10711071
$this->_selfCondition = $insertID;
10721072
// Event
10731073
$this->afterSave(true, $this->_readProperties);
1074+
// Reset properties
1075+
$this->_writeProperties = [];
10741076
}
10751077

10761078
} else {
@@ -1091,11 +1093,10 @@ public function save($runValidation=true)
10911093
$this->_readProperties = array_merge($this->_readProperties, $this->_writeProperties);
10921094
// Event
10931095
$this->afterSave(true, $this->_readProperties);
1096+
// Reset properties
1097+
$this->_writeProperties = [];
10941098
}
10951099
}
1096-
1097-
// Reset properties
1098-
$this->_writeProperties = [];
10991100

11001101
return $result;
11011102
}

0 commit comments

Comments
 (0)