function StubLockBackendAbstract::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 TRUE if the lock was successfully acquired, FALSE otherwise.

Overrides LockBackendInterface::acquire

File

core/tests/Drupal/Tests/Core/Lock/StubLockBackendAbstract.php, line 17

Class

StubLockBackendAbstract
A stub of the abstract LockBackendAbstract class for testing purposes.

Namespace

Drupal\Tests\Core\Lock

Code

public function acquire($name, $timeout = 30.0) : bool {
  return TRUE;
}

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