SharedTempStore deprecated
class SharedTempStore extends SharedTempStore (View source)
deprecated
Stores and retrieves temporary data for a given owner.
Traits
Provides dependency injection friendly methods for serialization.
Properties
| protected array | $_serviceIds | An array of service IDs keyed by property name used for serialization. |
from DependencySerializationTrait |
| protected array | $_entityStorages | An array of entity type IDs keyed by the property name of their storages. |
from DependencySerializationTrait |
| protected KeyValueStoreExpirableInterface | $storage | The key/value storage object used for this data. |
from SharedTempStore |
| protected LockBackendInterface | $lockBackend | The lock object used for this data. |
from SharedTempStore |
| protected RequestStack | $requestStack | The request stack. |
from SharedTempStore |
| protected mixed | $owner | The owner key to store along with the data (e.g. a user or session ID). |
from SharedTempStore |
| protected int | $expire | The time to live for items in seconds. |
from SharedTempStore |
Methods
Constructs a new object for accessing data from a key/value store.
Retrieves a value from this SharedTempStore for a given key.
Retrieves a value from this SharedTempStore for a given key.
Stores a particular key/value pair only if the key doesn't already exist.
Stores a particular key/value pair in this SharedTempStore.
Stores a particular key/value pair in this SharedTempStore.
Returns the metadata associated with a particular key/value pair.
Deletes data from the store for a given key and releases the lock on it.
Deletes data from the store for a given key and releases the lock on it.
Details
__sleep()
{@inheritdoc}
__wakeup()
{@inheritdoc}
__construct(KeyValueStoreExpirableInterface $storage, LockBackendInterface $lock_backend, mixed $owner, RequestStack $request_stack, int $expire = 604800)
Constructs a new object for accessing data from a key/value store.
mixed
get(string $key)
Retrieves a value from this SharedTempStore for a given key.
mixed
getIfOwner(string $key)
Retrieves a value from this SharedTempStore for a given key.
Only returns the value if the value is owned by $this->owner.
bool
setIfNotExists(string $key, mixed $value)
Stores a particular key/value pair only if the key doesn't already exist.
bool
setIfOwner(string $key, mixed $value)
Stores a particular key/value pair in this SharedTempStore.
Only stores the given key/value pair if it does not exist yet or is owned by $this->owner.
set(string $key, mixed $value)
Stores a particular key/value pair in this SharedTempStore.
Lock|null
getMetadata(string $key)
Returns the metadata associated with a particular key/value pair.
delete(string $key)
Deletes data from the store for a given key and releases the lock on it.
bool
deleteIfOwner(string $key)
Deletes data from the store for a given key and releases the lock on it.
Only delete the given key if it is owned by $this->owner.