class LocaleProjectStorage implements LocaleProjectStorageInterface (View source)

Provides the locale project storage system using a key value store.

Properties

protected KeyValueStoreInterface $keyValueStore

The key value store to use.

protected array $cache

Static state cache.

static protected bool $all

Cache status flag.

Methods

__construct(KeyValueFactoryInterface $key_value_factory)

Constructs a State object.

mixed
get(string $key, mixed $default = NULL)

Returns the stored value for a given key.

array
getMultiple(array $keys)

Returns a list of project records.

set(string $key, mixed $value)

Creates or updates the project record.

setMultiple(array $data)

Creates or updates multiple project records.

delete(string $key)

Deletes project records for a given key.

deleteMultiple(array $keys)

Deletes multiple project records.

resetCache()

Resets the project storage cache.

array
deleteAll()

Deletes all projects records.

disableAll()

Mark all projects as disabled.

int
countProjects()

Returns the count of project records.

array
getAll()

Returns all the project records.

Details

__construct(KeyValueFactoryInterface $key_value_factory)

Constructs a State object.

Parameters

KeyValueFactoryInterface $key_value_factory

The key value store to use.

mixed get(string $key, mixed $default = NULL)

Returns the stored value for a given key.

Parameters

string $key

The key of the data to retrieve.

mixed $default

The default value to use if the key is not found.

Return Value

mixed

The stored value, or the default value if no value exists.

array getMultiple(array $keys)

Returns a list of project records.

Parameters

array $keys

A list of keys to retrieve.

Return Value

array

An associative array of items successfully returned, indexed by key.

set(string $key, mixed $value)

Creates or updates the project record.

Parameters

string $key

The key of the data to store.

mixed $value

The data to store.

setMultiple(array $data)

Creates or updates multiple project records.

Parameters

array $data

An associative array of key/value pairs.

delete(string $key)

Deletes project records for a given key.

Parameters

string $key

The key of the data to delete.

deleteMultiple(array $keys)

Deletes multiple project records.

Parameters

array $keys

A list of item names to delete.

resetCache()

Resets the project storage cache.

array deleteAll()

Deletes all projects records.

Return Value

array

An associative array of items successfully returned, indexed by key.

disableAll()

Mark all projects as disabled.

int countProjects()

Returns the count of project records.

Return Value

int

The number of saved items.

array getAll()

Returns all the project records.

Return Value

array

An associative array of items successfully returned, indexed by key.