diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-08-10 14:15:44 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-08-10 14:15:44 +0200 |
commit | 58e96e53b039365751eb8c4a2d511fcfcf507891 (patch) | |
tree | 997d2a7726ba44601d6df3e95bfea5b08606a25a /lib/private/db | |
parent | 06065189d768e5b33cb4798403db34b12cb60ef7 (diff) | |
download | nextcloud-server-58e96e53b039365751eb8c4a2d511fcfcf507891.tar.gz nextcloud-server-58e96e53b039365751eb8c4a2d511fcfcf507891.zip |
add method to check if we're inside a transaction
Diffstat (limited to 'lib/private/db')
-rw-r--r-- | lib/private/db/connection.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/private/db/connection.php b/lib/private/db/connection.php index def3f2fd120..4d33cd968af 100644 --- a/lib/private/db/connection.php +++ b/lib/private/db/connection.php @@ -291,4 +291,14 @@ class Connection extends \Doctrine\DBAL\Connection implements IDBConnection { protected function replaceTablePrefix($statement) { return str_replace( '*PREFIX*', $this->tablePrefix, $statement ); } + + /** + * Check if a transaction is active + * + * @return bool + * @since 8.2.0 + */ + public function inTransaction() { + return $this->getTransactionNestingLevel() > 0; + } } |