function TransactionManagerBase::voidClientTransaction

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

Voids the client connection.

Void any existing items on the stack so that when outliving Transaction objects get out of scope they will not try operations on the database.

This method should only be called internally by a database driver.

Overrides TransactionManagerInterface::voidClientTransaction

4 calls to TransactionManagerBase::voidClientTransaction()
TransactionManagerBase::commit in core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php
Commits a Drupal transaction.
TransactionManagerBase::handleAutomaticCommit in core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php
Manages the occurrence of an automatic commit.
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.

File

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

Class

TransactionManagerBase
The database transaction manager base class.

Namespace

Drupal\Core\Database\Transaction

Code

public function voidClientTransaction() : void {
  while ($i = array_key_last($this->stack())) {
    $this->voidStackItem((string) $i);
  }
  if ($this->getConnectionTransactionState() === ClientConnectionTransactionState::Active) {
    $this->setConnectionTransactionState(ClientConnectionTransactionState::Voided);
  }
}

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