function Drupal::lock

Same name in other branches
  1. 9 core/lib/Drupal.php \Drupal::lock()
  2. 10 core/lib/Drupal.php \Drupal::lock()
  3. 11.x core/lib/Drupal.php \Drupal::lock()

Returns the locking layer instance.

Return value

\Drupal\Core\Lock\LockBackendInterface

Related topics

10 calls to Drupal::lock()
DrupalTest::testLock in core/tests/Drupal/Tests/Core/DrupalTest.php
Tests the lock() method.
RegistryLegacyTest::testMultipleSubThemes in core/tests/Drupal/KernelTests/Core/Theme/RegistryLegacyTest.php
Tests the theme registry with theme functions and multiple subthemes.
RegistryLegacyTest::testSuggestionPreprocessFunctions in core/tests/Drupal/KernelTests/Core/Theme/RegistryLegacyTest.php
Tests the theme registry with theme functions with suggestions.
RegistryTest::testMultipleSubThemes in core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
Tests the theme registry with multiple subthemes.
RegistryTest::testRaceCondition in core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
Tests the behavior of the theme registry class.

... See full list

File

core/lib/Drupal.php, line 367

Class

Drupal
Static Service Container wrapper.

Code

public static function lock() {
    return static::getContainer()->get('lock');
}

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