function TransactionManagerBase::inTransaction

Same name in other branches
  1. 10 core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php \Drupal\Core\Database\Transaction\TransactionManagerBase::inTransaction()

Overrides TransactionManagerInterface::inTransaction

2 calls to TransactionManagerBase::inTransaction()
TransactionManagerBase::addPostTransactionCallback in core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php
Adds a root transaction end callback.
TransactionManagerBase::push in core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php
Pushes a new Drupal transaction on the stack.

File

core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php, line 234

Class

TransactionManagerBase
The database transaction manager base class.

Namespace

Drupal\Core\Database\Transaction

Code

public function inTransaction() : bool {
    return (bool) $this->stackDepth() && $this->getConnectionTransactionState() === ClientConnectionTransactionState::Active;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.