function TransactionManagerBase::dumpStackItemsAsString

Same name and namespace in other branches
  1. 11.x 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
TransactionManagerBase::rollback in core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php
TransactionManagerBase::unpile in core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php
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.