You are here

public function MongodbLock::releaseAll in MongoDB 8

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

src/MongodbLock.php, line 145
Contains \Drupal\mongodb\MongodbLock.

Class

MongodbLock

Namespace

Drupal\mongodb

Code

public function releaseAll($lockId = 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
      ->mongoCollection()
      ->remove([
      '_id.value' => $lock_id,
    ]);
  }
}