Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MongoDbStore.php

function MongoDbStore::getUniqueToken

Retrieves a unique token for the given key namespaced to this store.

Parameters

Key $key lock state container:

3 calls to MongoDbStore::getUniqueToken()
MongoDbStore::delete in vendor/symfony/lock/Store/MongoDbStore.php
Removes a resource from the storage.
MongoDbStore::exists in vendor/symfony/lock/Store/MongoDbStore.php
Returns whether or not the resource exists in the storage.
MongoDbStore::upsert in vendor/symfony/lock/Store/MongoDbStore.php
Update or Insert a Key.

File

vendor/symfony/lock/Store/MongoDbStore.php, line 366

Class

MongoDbStore
MongoDbStore is a StoreInterface implementation using MongoDB as a storage engine. Support for MongoDB server >=2.2 due to use of TTL indexes.

Namespace

Symfony\Component\Lock\Store

Code

private function getUniqueToken(Key $key) : string {
    if (!$key->hasState(__CLASS__)) {
        $token = base64_encode(random_bytes(32));
        $key->setState(__CLASS__, $token);
    }
    return $key->getState(__CLASS__);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal