function Drupal::lock

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

Returns the locking layer instance.

Return value

\Drupal\Core\Lock\LockBackendInterface

Related topics

9 calls to Drupal::lock()
DrupalTest::testLock in core/tests/Drupal/Tests/Core/DrupalTest.php
Tests the lock() method.
PerformanceDataCollector::destruct in core/modules/system/tests/modules/performance_test/src/PerformanceDataCollector.php
Performs destruct operations.
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.
RegistryTest::testSuggestionPreprocessFunctions in core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
Tests the theme registry with suggestions.

... See full list

File

core/lib/Drupal.php, line 391

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.