mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Optimization to Model::save().
This commit is contained in:
parent
c196c2cbdf
commit
137704e397
1 changed files with 7 additions and 9 deletions
|
@ -1393,7 +1393,7 @@ class Model extends Overloadable {
|
|||
}
|
||||
|
||||
if (!empty($joined) && $success === true) {
|
||||
$this->__saveMulti($joined, $this->id);
|
||||
$this->__saveMulti($joined, $this->id, $db);
|
||||
}
|
||||
|
||||
if ($success && $count > 0) {
|
||||
|
@ -1423,9 +1423,7 @@ class Model extends Overloadable {
|
|||
* @param mixed $id ID of record in this model
|
||||
* @access private
|
||||
*/
|
||||
function __saveMulti($joined, $id) {
|
||||
$db =& ConnectionManager::getDataSource($this->useDbConfig);
|
||||
|
||||
function __saveMulti($joined, $id, &$db) {
|
||||
foreach ($joined as $assoc => $data) {
|
||||
|
||||
if (isset($this->hasAndBelongsToMany[$assoc])) {
|
||||
|
|
Loading…
Reference in a new issue