function TransactionManagerBase::stackDepth

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php \Drupal\Core\Database\Transaction\TransactionManagerBase::stackDepth()

Returns the current depth of the transaction stack.

@todo consider making this function protected.

@internal

Return value

int The current depth of the transaction stack.

4 calls to TransactionManagerBase::stackDepth()
TransactionManagerBase::inTransaction in core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php
Determines if there is an active transaction open.
TransactionManagerBase::push in core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php
Pushes a new Drupal transaction on the stack.
TransactionManagerBase::rollback in core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php
Rolls back a Drupal transaction.
TransactionManagerBase::unpile in core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php
Removes a Drupal transaction from the stack.

File

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

Class

TransactionManagerBase
The database transaction manager base class.

Namespace

Drupal\Core\Database\Transaction

Code

public function stackDepth() : int {
    return count($this->stack());
}

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