W3cubDocs

/Drupal 8

public function DatabaseLockBackend::releaseAll

public DatabaseLockBackend::releaseAll($lock_id = NULL)

Releases all locks for the given lock token identifier.

Parameters

string $lockId: (optional) If none given, remove all locks from the current page. Defaults to NULL.

Overrides LockBackendInterface::releaseAll

File

core/lib/Drupal/Core/Lock/DatabaseLockBackend.php, line 154

Class

DatabaseLockBackend
Defines the database lock backend. This is the default backend in Drupal.

Namespace

Drupal\Core\Lock

Code

public function releaseAll($lock_id = NULL) {
  // Only attempt to release locks if any were acquired.
  if (!empty($this->locks)) {
    $this->locks = array();
    if (empty($lock_id)) {
      $lock_id = $this->getLockId();
    }
    $this->database->delete('semaphore')
      ->condition('value', $lock_id)
      ->execute();
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Lock!DatabaseLockBackend.php/function/DatabaseLockBackend::releaseAll/8.1.x