function TransactionManagerInterface::rollback

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Database/Transaction/TransactionManagerInterface.php \Drupal\Core\Database\Transaction\TransactionManagerInterface::rollback()

Rolls back a Drupal transaction.

Rollbacks for nested transactions need to occur in reverse order to the pushes to the stack. Rolling back the last active Drupal transaction leads to rolling back the client connection (or to committing it in the edge case when the root was unpiled earlier).

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

Parameters

string $name: The name of the transaction.

string $id: The id of the transaction.

Throws

\Drupal\Core\Database\TransactionNoActiveException If there is no active client connection.

\Drupal\Core\Database\TransactionOutOfOrderException If the order of rollback is not in reverse sequence against the pushes to the stack.

\Drupal\Core\Database\TransactionCommitFailedException If the commit of the root transaction failed.

1 method overrides TransactionManagerInterface::rollback()
TransactionManagerBase::rollback in core/lib/Drupal/Core/Database/Transaction/TransactionManagerBase.php
Rolls back a Drupal transaction.

File

core/lib/Drupal/Core/Database/Transaction/TransactionManagerInterface.php, line 96

Class

TransactionManagerInterface
Interface for the database transaction manager classes.

Namespace

Drupal\Core\Database\Transaction

Code

public function rollback(string $name, string $id) : void;

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