class KeyValueFactory implements KeyValueFactoryInterface (View source)

Defines the key/value store factory.

Constants

SPECIFIC_PREFIX

The specific setting name prefix.

The collection name will be prefixed with this constant and used as a setting name. The setting value will be the id of a service.

DEFAULT_SETTING

The default setting name.

This is a setting name that will be used if the specific setting does not exist. The setting value will be the id of a service.

DEFAULT_SERVICE

The default service id.

If the default setting does not exist, this is the default service id.

Properties

protected array $stores

Instantiated stores, keyed by collection name.

protected ContainerInterface $container

The service container.

protected array $options

Collection-specific storage override options.

Methods

__construct(ContainerInterface $container, array $options = [])

No description

get(string $collection)

Constructs a new key/value store for a given collection name.

Details

__construct(ContainerInterface $container, array $options = [])

No description

Parameters

ContainerInterface $container

The service container.

array $options

(optional) Collection-specific storage override options.

KeyValueStoreInterface get(string $collection)

Constructs a new key/value store for a given collection name.

Parameters

string $collection

The name of the collection holding key and value pairs.

Return Value

KeyValueStoreInterface

A key/value store implementation for the given $collection.