Skip to content
Permalink
Browse files

Remove unnecessary param when calling begin, commit and rollback on d…

…atasource.
  • Loading branch information...
majna committed Jan 17, 2012
1 parent c718b10 commit 826374e57ca5dcc003b8e540da03ba67e11704c1
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/Cake/Model/Model.php
@@ -2034,7 +2034,7 @@ public function saveMany($data = null, $options = array()) {
if ($options['atomic']) {
$db = $this->getDataSource();
$transactionBegun = $db->begin($this);
$transactionBegun = $db->begin();
}
$return = array();
foreach ($data as $key => $record) {
@@ -2055,12 +2055,12 @@ public function saveMany($data = null, $options = array()) {
}
if ($validates) {
if ($transactionBegun) {
return $db->commit($this) !== false;
return $db->commit() !== false;
} else {
return true;
}
}
$db->rollback($this);
$db->rollback();
return false;
}
@@ -2138,7 +2138,7 @@ public function saveAssociated($data = null, $options = array()) {
}
if ($options['atomic']) {
$db = $this->getDataSource();
$transactionBegun = $db->begin($this);
$transactionBegun = $db->begin();
}
$associations = $this->getAssociated();
$return = array();
@@ -2200,12 +2200,12 @@ public function saveAssociated($data = null, $options = array()) {
}
if ($validates) {
if ($transactionBegun) {
return $db->commit($this) !== false;
return $db->commit() !== false;
} else {
return true;
}
}
$db->rollback($this);
$db->rollback();
return false;
}

0 comments on commit 826374e

Please sign in to comment.
You can’t perform that action at this time.