From 09b0b1fbe311ddfe9c6a8c30c752629d4873a752 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 20 Feb 2012 16:53:24 -0500 Subject: [PATCH] Added transaction functions to firebird driver --- src/databases/firebird.php | 37 ++++++++++++++++++++++++++++++++++++- src/windows/add_db.php | 3 ++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/databases/firebird.php b/src/databases/firebird.php index 64c29d3..d332e36 100644 --- a/src/databases/firebird.php +++ b/src/databases/firebird.php @@ -19,7 +19,7 @@ */ class firebird { - protected $conn, $statement; + protected $conn, $statement, $trans; private $esc_char = "''"; /** @@ -212,6 +212,41 @@ SQL; } return $count; + } + + /** + * Start a database transaction + * + * @return resource + */ + function beingTransaction() + { + if($this->trans = ibase_trans($this->conn) !== null) + { + return TRUE; + } + + return FALSE; + } + + /** + * Commit a database transaction + * + * @return bool + */ + function commit() + { + return ibase_commit($this->trans); + } + + /** + * Rollback a transaction + * + * @return bool + */ + function rollBack() + { + return ibase_rollback($this->trans); } } // End of firebird.php \ No newline at end of file diff --git a/src/windows/add_db.php b/src/windows/add_db.php index a312850..93d299d 100644 --- a/src/windows/add_db.php +++ b/src/windows/add_db.php @@ -77,7 +77,8 @@ class Add_DB extends GtkWindow { // DB File { $filelbl = new GtkLabel("Database file"); - $this->dbfile = new GtkFileChooserButton("Select a database file", Gtk::FILE_CHOOSER_ACTION_OPEN); + $this->dbfile = new GtkFileChooserButton("Select a database file", + Gtk::FILE_CHOOSER_ACTION_OPEN); $filealign = new GtkAlignment(0, 0.5, 0, 0); $filealign->add($filelbl);