1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-05 21:58:10 +02:00

PostgreSQL: implemented inTransaction()

This commit is contained in:
David Grudl
2010-08-03 20:20:37 +02:00
parent 66e709e846
commit dc62e87629

View File

@@ -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