function Transaction::rollBack

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Database/Transaction.php \Drupal\Core\Database\Transaction::rollBack()
  2. 8.9.x core/lib/Drupal/Core/Database/Transaction.php \Drupal\Core\Database\Transaction::rollBack()
  3. 10 core/lib/Drupal/Core/Database/Transaction.php \Drupal\Core\Database\Transaction::rollBack()

Rolls back the transaction.

Depending on the state of the transaction stack, this leads to a ROLLBACK operation (for a root item), or to a ROLLBACK TO SAVEPOINT + a RELEASE SAVEPOINT operations (for a savepoint item) executed on the database.

File

core/lib/Drupal/Core/Database/Transaction.php, line 66

Class

Transaction
A wrapper class for creating and managing database transactions.

Namespace

Drupal\Core\Database

Code

public function rollBack() {
  $this->connection
    ->transactionManager()
    ->rollback($this->name, $this->id);
}

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