summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2020-01-28 20:39:30 +0100
committerAndrey Andreev <narf@devilix.net>2020-01-28 20:40:06 +0100
commit04677270238b52206fc3c3a6894f576d9cc84b98 (patch)
treeff7a2e653d0a03d54721eeec0f3ec77a71199159 /system/database
parent35480f753240dd913dca879e277bd7b710195546 (diff)
[ci skip] Merge pull request #5890 from jerkob/develop
Adds a public trans_active function to determine transaction state
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB_driver.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 5ae0442a3..eee9ef20f 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -887,6 +887,18 @@ abstract class CI_DB_driver {
{
return $this->_trans_status;
}
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Returns TRUE if a transaction is currently active
+ *
+ * @return bool
+ */
+ public function trans_active()
+ {
+ return (bool) $this->_trans_depth;
+ }
// --------------------------------------------------------------------