You are here

protected function KeyValueStore::stringifyKey in MongoDB 8.2

Represents any value as a string. May incur data loss.

This loss is acceptable because keys should be string anyway, and any non- string uses as a key may be an injection attempt.

Parameters

mixed $key: Is expected to be a key or behave as such.

Return value

string The string version of the key.

6 calls to KeyValueStore::stringifyKey()
KeyValueStore::has in modules/mongodb_storage/src/KeyValueStore.php
Returns whether a given key exists in the store.
KeyValueStore::rename in modules/mongodb_storage/src/KeyValueStore.php
Renames a key.
KeyValueStore::set in modules/mongodb_storage/src/KeyValueStore.php
Saves a value for a given key.
KeyValueStore::setIfNotExists in modules/mongodb_storage/src/KeyValueStore.php
Saves a value for a given key if it does not exist yet.
KeyValueStoreExpirable::setWithExpire in modules/mongodb_storage/src/KeyValueStoreExpirable.php
Saves a value for a given key with a time to live.

... See full list

File

modules/mongodb_storage/src/KeyValueStore.php, line 250

Class

KeyValueStore
Class KeyValueStore provides a KeyValueStore as a MongoDB collection.

Namespace

Drupal\mongodb_storage

Code

protected function stringifyKey($key) {
  return "{$key}";
}