function Transaction::rollBack
Same name in other branches
- 9 core/lib/Drupal/Core/Database/Transaction.php \Drupal\Core\Database\Transaction::rollBack()
- 8.9.x core/lib/Drupal/Core/Database/Transaction.php \Drupal\Core\Database\Transaction::rollBack()
- 10 core/lib/Drupal/Core/Database/Transaction.php \Drupal\Core\Database\Transaction::rollBack()
Rolls back the current transaction.
This is just a wrapper method to rollback whatever transaction stack we are currently in, which is managed by the TransactionManager. Note that logging needs to happen after a transaction has been rolled back or the log messages will be rolled back too.
Depending on the nesting level of the object, this leads to a ROLLBACK (for a root item) or to a ROLLBACK TO SAVEPOINT (for a savepoint item) executed on the database.
File
-
core/
lib/ Drupal/ Core/ Database/ Transaction.php, line 60
Class
- Transaction
- A wrapper class for creating and managing database transactions.
Namespace
Drupal\Core\DatabaseCode
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.