From dc62e87629db6039aa7e3bb46e10f5c377b061db Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 3 Aug 2010 20:20:37 +0200 Subject: [PATCH] PostgreSQL: implemented inTransaction() --- dibi/drivers/postgre.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dibi/drivers/postgre.php b/dibi/drivers/postgre.php index 6e2a2bfd..99d6f657 100644 --- a/dibi/drivers/postgre.php +++ b/dibi/drivers/postgre.php @@ -208,6 +208,17 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver, IDibiReflecto + /** + * Is in transaction? + * @return bool + */ + public function inTransaction() + { + return !in_array(pg_transaction_status($this->connection), array(PGSQL_TRANSACTION_UNKNOWN, PGSQL_TRANSACTION_IDLE), TRUE); + } + + + /** * Returns the connection resource. * @return mixed