Skip to content

Commit

Permalink
Merge pull request #3163 from michalsn/fix_batch_model
Browse files Browse the repository at this point in the history
Fix testMode() for batch methods in Model
  • Loading branch information
michalsn authored Jun 24, 2020
2 parents 30ad13f + 0194640 commit f66f324
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions system/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -759,9 +759,8 @@ public function insert($data = null, bool $returnID = true)
*
* @param array $set An associative array of insert values
* @param boolean $escape Whether to escape values and identifiers
*
* @param integer $batchSize
* @param boolean $testing
* @param integer $batchSize The size of the batch to run
* @param boolean $testing True means only number of records is returned, false will execute the query
*
* @return integer|boolean Number of rows inserted or FALSE on failure
*/
Expand All @@ -778,7 +777,7 @@ public function insertBatch(array $set = null, bool $escape = null, int $batchSi
}
}

return $this->builder()->insertBatch($set, $escape, $batchSize, $testing);
return $this->builder()->testMode($testing)->insertBatch($set, $escape, $batchSize);
}

//--------------------------------------------------------------------
Expand Down Expand Up @@ -901,7 +900,7 @@ public function updateBatch(array $set = null, string $index = null, int $batchS
}
}

return $this->builder()->updateBatch($set, $index, $batchSize, $returnSQL);
return $this->builder()->testMode($returnSQL)->updateBatch($set, $index, $batchSize);
}

//--------------------------------------------------------------------
Expand Down

0 comments on commit f66f324

Please sign in to comment.