ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\KeyValueStorage\Store Interface Reference

Key-value store scoped to one namespace. More...

+ Inheritance diagram for ILIAS\KeyValueStorage\Store:
+ Collaboration diagram for ILIAS\KeyValueStorage\Store:

Public Member Functions

 has (string $key)
 Reads the value along, so that a following get() does not read again. More...
 
 get (string $key, Transformation $transformation)
 Reads a value and applies a Refinery transformation, like HTTP request wrappers. More...
 
 getMany (array $transformations)
 Reads several known keys, each with its own Refinery transformation. More...
 
 keys ()
 The keys this namespace currently holds, sorted as strings. More...
 
 set (string $key, mixed $value)
 
 delete (string $key)
 
 clear ()
 Removes every entry of this namespace, and only of this namespace. More...
 

Detailed Description

Key-value store scoped to one namespace.

This is application state, not a cache: values are kept until they are changed or cleared. Use ILIAS\Cache for data that may be dropped at any time.

Definition at line 31 of file Store.php.

Member Function Documentation

◆ clear()

ILIAS\KeyValueStorage\Store::clear ( )

Removes every entry of this namespace, and only of this namespace.

Implemented in ILIAS\KeyValueStorage\Internal\NamespacedStore.

◆ delete()

ILIAS\KeyValueStorage\Store::delete ( string  $key)
Exceptions

InvalidArgumentException if the key is invalid

Implemented in ILIAS\KeyValueStorage\Internal\NamespacedStore.

◆ get()

ILIAS\KeyValueStorage\Store::get ( string  $key,
Transformation  $transformation 
)

Reads a value and applies a Refinery transformation, like HTTP request wrappers.

Absent keys are passed to the transformation as null.

Exceptions

InvalidArgumentException if the key is invalid

Exceptions
Exception

InvalidStoredValueException if the stored value cannot be read back

Implemented in ILIAS\KeyValueStorage\Internal\NamespacedStore.

◆ getMany()

ILIAS\KeyValueStorage\Store::getMany ( array  $transformations)

Reads several known keys, each with its own Refinery transformation.

The result has the same keys as the given map, in the same order. Absent keys are passed to their transformation as null, like {

See also
self::get()}. Keys that the namespace holds besides those named here are left out.
Parameters
array<string,Transformation>$transformations
Returns
array<string, mixed>
Exceptions

InvalidArgumentException if a key is invalid or an entry is not a transformation

Exceptions
Exception

InvalidStoredValueException if a stored value cannot be read back

Implemented in ILIAS\KeyValueStorage\Internal\NamespacedStore.

◆ has()

ILIAS\KeyValueStorage\Store::has ( string  $key)

Reads the value along, so that a following get() does not read again.

Exceptions

InvalidArgumentException if the key is invalid

Exceptions
Exception

InvalidStoredValueException if the stored value cannot be read back

Implemented in ILIAS\KeyValueStorage\Internal\NamespacedStore.

◆ keys()

ILIAS\KeyValueStorage\Store::keys ( )

The keys this namespace currently holds, sorted as strings.

Returns
list<string>

Implemented in ILIAS\KeyValueStorage\Internal\NamespacedStore.

◆ set()

ILIAS\KeyValueStorage\Store::set ( string  $key,
mixed  $value 
)
Exceptions

InvalidArgumentException if the key is invalid or the value cannot be stored

Implemented in ILIAS\KeyValueStorage\Internal\NamespacedStore.


The documentation for this interface was generated from the following file: