Skip to content

Commit

Permalink
Added rollbackTransaction function to drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jul 4, 2012
1 parent a6f62c7 commit 493ddc7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Cake/Model/Datasource/Database/Driver.php
Expand Up @@ -53,6 +53,14 @@ public abstract function beginTransaction();
**/
public abstract function commitTransaction();

/**
* Rollsback a transaction
*
* @return boolean true on success, false otherwise
**/
public abstract function rollbackTransaction();



/**
* Returns whether this driver supports save points for nested transactions
Expand Down
9 changes: 9 additions & 0 deletions lib/Cake/Model/Datasource/Database/Driver/Mysql.php
Expand Up @@ -102,4 +102,13 @@ public function commitTransaction() {
return $this->_connection->commit();
}

/**
* Rollsback a transaction
*
* @return boolean true on success, false otherwise
**/
public function rollbackTransaction() {
return $this->_connection->rollback();
}

}

0 comments on commit 493ddc7

Please sign in to comment.