summaryrefslogtreecommitdiffstats
path: root/system/database/DB_driver.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2020-01-28 20:39:30 +0100
committerGitHub <noreply@github.com>2020-01-28 20:39:30 +0100
commit2ad24af488da7dc518684cc146914b2937749031 (patch)
treeed521666411579749d117091df4b507268830b14 /system/database/DB_driver.php
parent28f50a8f4a701e76b17aa91f00fae662aea22876 (diff)
parent259da38bedb09b4df1a94a922ec9b3e8d4f53d23 (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/DB_driver.php')
-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 b4f16b905..f3433f849 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -825,6 +825,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;
+ }
// --------------------------------------------------------------------