function TransactionManagerBase::dumpStackItemsAsString

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

Produces a string representation of the stack items.

A helper method for exception messages.

Drivers should not override this method unless they also override the $stack property.

Return value

string The string representation of the stack items.

4 calls to TransactionManagerBase::dumpStackItemsAsString()
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.
TransactionManagerBase::__destruct in core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php
Destructor.

File

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

Class

TransactionManagerBase
The database transaction manager base class.

Namespace

Drupal\Core\Database\Transaction

Code

protected function dumpStackItemsAsString() : string {
    if ($this->stack() === []) {
        return '*** empty ***';
    }
    $temp = [];
    foreach ($this->stack() as $id => $item) {
        $temp[] = $id . '\\' . $item->name;
    }
    return implode(' > ', $temp);
}

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