function Transaction::__destruct

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

Destructs the object.

Depending on the nesting level of the object, this leads to a COMMIT (for a root item) or to a RELEASE SAVEPOINT (for a savepoint item) executed on the database.

File

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

Class

Transaction
A wrapper class for creating and managing database transactions.

Namespace

Drupal\Core\Database

Code

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

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