class MemorySettingStore extends SettingStore

Properties

protected array $items

The settings items.

from  SettingStore
protected bool $unsaved

Whether the store has changed since it was last loaded.

from  SettingStore
protected bool $loaded

Whether the settings data are loaded.

from  SettingStore

Methods

mixed
get(string|array $key, mixed $default = null)

Get a specific key from the settings data.

bool
has(string $key)

Determine if a key exists in the settings data.

set(string|array $key, mixed $value = null)

Set a specific key to a value in the settings data.

forget(string $key)

Unset a key in the settings data.

void
forgetAll()

Unset all keys in the settings data.

array
all()

Get all settings data.

void
save()

Save any changes done to the settings data.

load(bool $force = false)

Make sure data is loaded.

array
read()

Read the data from the store.

void
write(array $items)

Write the data into the store.

__construct(array $items = null)

No description

Details

in SettingStore at line 35
mixed get(string|array $key, mixed $default = null)

Get a specific key from the settings data.

Parameters

string|array $key
mixed $default

Optional default value.

Return Value

mixed

in SettingStore at line 49
bool has(string $key)

Determine if a key exists in the settings data.

Parameters

string $key

Return Value

bool

in SettingStore at line 62
set(string|array $key, mixed $value = null)

Set a specific key to a value in the settings data.

Parameters

string|array $key

Key string or associative array of key => value

mixed $value

Optional only if the first argument is an array

in SettingStore at line 84
forget(string $key)

Unset a key in the settings data.

Parameters

string $key

in SettingStore at line 97
void forgetAll()

Unset all keys in the settings data.

Return Value

void

in SettingStore at line 107
array all()

Get all settings data.

Return Value

array

in SettingStore at line 118
void save()

Save any changes done to the settings data.

Return Value

void

in SettingStore at line 135
load(bool $force = false)

Make sure data is loaded.

Parameters

bool $force

Force a reload of data. Default false.

at line 20
protected array read()

Read the data from the store.

Return Value

array

at line 28
protected void write(array $items)

Write the data into the store.

Parameters

array $items

Return Value

void

at line 10
__construct(array $items = null)

No description

Parameters

array $items