function LockBackendInterface::acquire
Same name in other branches
- 9 core/lib/Drupal/Core/Lock/LockBackendInterface.php \Drupal\Core\Lock\LockBackendInterface::acquire()
- 8.9.x core/lib/Drupal/Core/Lock/LockBackendInterface.php \Drupal\Core\Lock\LockBackendInterface::acquire()
- 10 core/lib/Drupal/Core/Lock/LockBackendInterface.php \Drupal\Core\Lock\LockBackendInterface::acquire()
Acquires a lock.
Parameters
string $name: Lock name. Limit of name's length is 255 characters.
float $timeout: (optional) Lock lifetime in seconds. Defaults to 30.0.
Return value
bool
4 methods override LockBackendInterface::acquire()
- DatabaseLockBackend::acquire in core/
lib/ Drupal/ Core/ ProxyClass/ Lock/ DatabaseLockBackend.php - Acquires a lock.
- DatabaseLockBackend::acquire in core/
lib/ Drupal/ Core/ Lock/ DatabaseLockBackend.php - Acquires a lock.
- NullLockBackend::acquire in core/
lib/ Drupal/ Core/ Lock/ NullLockBackend.php - Acquires a lock.
- PersistentDatabaseLockBackend::acquire in core/
lib/ Drupal/ Core/ ProxyClass/ Lock/ PersistentDatabaseLockBackend.php - Acquires a lock.
File
-
core/
lib/ Drupal/ Core/ Lock/ LockBackendInterface.php, line 95
Class
- LockBackendInterface
- Lock backend interface.
Namespace
Drupal\Core\LockCode
public function acquire($name, $timeout = 30.0);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.