You are here

public function LockBackendAbstract::getLockId in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Lock/LockBackendAbstract.php \Drupal\Core\Lock\LockBackendAbstract::getLockId()

Gets the unique page token for locks.

Locks will be wiped out at the end of each page request on a token basis.

Return value

string

Overrides LockBackendInterface::getLockId

2 calls to LockBackendAbstract::getLockId()
DatabaseLockBackend::releaseAll in core/lib/Drupal/Core/Lock/DatabaseLockBackend.php
Releases all locks for the given lock token identifier.
MemcacheLockBackend::acquire in modules/memcache/src/MemcacheLockBackend.php
Acquires a lock.

File

core/lib/Drupal/Core/Lock/LockBackendAbstract.php, line 73
Contains \Drupal\Core\Lock\LockBackendAbstract.

Class

LockBackendAbstract
Non backend related common methods implementation for lock backends.

Namespace

Drupal\Core\Lock

Code

public function getLockId() {
  if (!isset($this->lockId)) {
    $this->lockId = uniqid(mt_rand(), TRUE);
  }
  return $this->lockId;
}