From a2decd151c42622cfd92120492532bf7f80b43be Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 14 Aug 2007 01:48:27 +0000 Subject: [PATCH] Renaming the transaction*() methods to just be the type of transaction statement to send, and removing savepoint support * DbMySql.php * DbMySqlI.php * Db.php * DbPostgreSql.php --- Db.php | 15 +++------------ DbMySql.php | 20 ++++---------------- DbMySqlI.php | 21 ++++----------------- DbPostgreSql.php | 23 +++++------------------ 4 files changed, 16 insertions(+), 63 deletions(-) diff --git a/Db.php b/Db.php index 9450351..2bfe2c5 100644 --- a/Db.php +++ b/Db.php @@ -423,16 +423,7 @@ abstract class BSDb * Sends the command to start a transaction. This command should never * be reached as it's always overridden */ - public abstract function transactionStart(); - - // ################################################################### - /** - * Sends the command to set this as a savepoint. This command should never - * be reached as it's always overridden - * - * @param string Named savepoint - */ - public abstract function transactionSavepoint($name); + public abstract function begin(); // ################################################################### /** @@ -441,14 +432,14 @@ abstract class BSDb * * @param string Named savepoint */ - public abstract function transactionRollback($name = null); + public abstract function rollback(); // ################################################################### /** * Sends the command to commit the entire transaction. This command * should never be reached as it's always overridden */ - public abstract function transactionCommit(); + public abstract function commit(); } /** diff --git a/DbMySql.php b/DbMySql.php index 94e59a7..a01db03 100644 --- a/DbMySql.php +++ b/DbMySql.php @@ -181,38 +181,26 @@ class BSDbMySql extends BSDb /** * Starts a database transaction */ - public function transactionStart() + public function begin() { $this->query("BEGIN WORK"); } - // ################################################################### - /** - * Saves current transaction steps as a savepoint - * - * @param string Named savepoint - */ - public function transactionSavepoint($name) - { - $this->query("SAVEPOINT $name"); - } // ################################################################### /** * Reverts a transaction back to a given savepoint - * - * @param string Named savepoint */ - public function transactionRollback($name = null) + public function rollback() { - $this->query("ROLLBACK" . ($name != null ? " TO SAVEPOINT $name" : "")); + $this->query("ROLLBACK"); } // ################################################################### /** * Commits a database transaction */ - public function transactionCommit() + public function commit() { $this->query("COMMIT"); } diff --git a/DbMySqlI.php b/DbMySqlI.php index 9e0dec0..e0dba3a 100644 --- a/DbMySqlI.php +++ b/DbMySqlI.php @@ -153,38 +153,25 @@ class BSDbMySqlI extends BSDb /** * Starts a database transaction */ - public function transactionStart() + public function begin() { $this->query("START TRANSACTION"); } - // ################################################################### - /** - * Saves current transaction steps as a savepoint - * - * @param string Named savepoint - */ - public function transactionSavepoint($name) - { - $this->query("SAVEPOINT $name"); - } - // ################################################################### /** * Reverts a transaction back to a given savepoint - * - * @param string Named savepoint */ - public function transactionRollback($name = null) + public function rollback() { - $this->query("ROLLBACK" . ($name != null ? " TO SAVEPOINT $name" : "")); + $this->query("ROLLBACK"); } // ################################################################### /** * Commits a database transaction */ - public function transactionCommit() + public function commit() { $this->query("COMMIT"); } diff --git a/DbPostgreSql.php b/DbPostgreSql.php index c49fd3b..5059427 100644 --- a/DbPostgreSql.php +++ b/DbPostgreSql.php @@ -172,38 +172,25 @@ class BSDbPostgreSql extends BSDb /** * Starts a database transaction */ - public function transactionStart() + public function start() { $this->query("BEGIN"); } - - // ################################################################### - /** - * Saves current transaction steps as a savepoint - * - * @param string Named savepoint - */ - public function transactionSavepoint($name) - { - $this->query("SAVEPOINT $name"); - } - + // ################################################################### /** * Reverts a transaction back to a given savepoint - * - * @param string Named savepoint */ - public function transactionRollback($name = null) + public function rollback() { - $this->query("ROLLBACK" . ($name != null ? " TO $name" : "")); + $this->query("ROLLBACK"); } // ################################################################### /** * Commits a database transaction */ - public function transactionCommit() + public function commit() { $this->query("COMMIT"); } -- 2.22.5