From 04677270238b52206fc3c3a6894f576d9cc84b98 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 28 Jan 2020 21:39:30 +0200 Subject: [ci skip] Merge pull request #5890 from jerkob/develop Adds a public trans_active function to determine transaction state --- system/database/DB_driver.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'system') 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; + } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b