function DatabaseLockBackend::__construct

Same name in this branch
  1. 9 core/lib/Drupal/Core/ProxyClass/Lock/DatabaseLockBackend.php \Drupal\Core\ProxyClass\Lock\DatabaseLockBackend::__construct()
Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/ProxyClass/Lock/DatabaseLockBackend.php \Drupal\Core\ProxyClass\Lock\DatabaseLockBackend::__construct()
  2. 8.9.x core/lib/Drupal/Core/Lock/DatabaseLockBackend.php \Drupal\Core\Lock\DatabaseLockBackend::__construct()
  3. 10 core/lib/Drupal/Core/ProxyClass/Lock/DatabaseLockBackend.php \Drupal\Core\ProxyClass\Lock\DatabaseLockBackend::__construct()
  4. 10 core/lib/Drupal/Core/Lock/DatabaseLockBackend.php \Drupal\Core\Lock\DatabaseLockBackend::__construct()
  5. 11.x core/lib/Drupal/Core/ProxyClass/Lock/DatabaseLockBackend.php \Drupal\Core\ProxyClass\Lock\DatabaseLockBackend::__construct()
  6. 11.x core/lib/Drupal/Core/Lock/DatabaseLockBackend.php \Drupal\Core\Lock\DatabaseLockBackend::__construct()

Constructs a new DatabaseLockBackend.

Parameters

\Drupal\Core\Database\Connection $database: The database connection.

1 method overrides DatabaseLockBackend::__construct()
PersistentDatabaseLockBackend::__construct in core/lib/Drupal/Core/Lock/PersistentDatabaseLockBackend.php
Constructs a new PersistentDatabaseLockBackend.

File

core/lib/Drupal/Core/Lock/DatabaseLockBackend.php, line 35

Class

DatabaseLockBackend
Defines the database lock backend. This is the default backend in Drupal.

Namespace

Drupal\Core\Lock

Code

public function __construct(Connection $database) {
    // __destruct() is causing problems with garbage collections, register a
    // shutdown function instead.
    drupal_register_shutdown_function([
        $this,
        'releaseAll',
    ]);
    $this->database = $database;
}

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