W3cubDocs

/Drupal 8

public function DatabaseLockBackend::__construct

public DatabaseLockBackend::__construct(Connection $database)

Constructs a new DatabaseLockBackend.

Parameters

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

File

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

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(array($this, 'releaseAll'));
  $this->database = $database;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Lock!DatabaseLockBackend.php/function/DatabaseLockBackend::__construct/8.1.x