You are here

public function Connection::__destruct in Drupal 9

Same name in this branch
  1. 9 core/lib/Drupal/Core/Database/Connection.php \Drupal\Core\Database\Connection::__destruct()
  2. 9 core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php \Drupal\Core\Database\Driver\sqlite\Connection::__destruct()
  3. 9 core/lib/Drupal/Core/Database/Driver/mysql/Connection.php \Drupal\Core\Database\Driver\mysql\Connection::__destruct()
Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Database/Driver/mysql/Connection.php \Drupal\Core\Database\Driver\mysql\Connection::__destruct()

Ensures that the PDO connection can be garbage collected.

Overrides Connection::__destruct

File

core/lib/Drupal/Core/Database/Driver/mysql/Connection.php, line 240

Class

Connection
MySQL implementation of \Drupal\Core\Database\Connection.

Namespace

Drupal\Core\Database\Driver\mysql

Code

public function __destruct() {
  if ($this->needsCleanup) {
    $this
      ->nextIdDelete();
  }
  parent::__destruct();
}