abstract class SettingStore

Properties

protected array $items

The settings items.

protected bool $unsaved

Whether the store has changed since it was last loaded.

protected bool $loaded

Whether the settings data are loaded.

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 $data)

Write the data into the store.

Details

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

at line 49
bool has(string $key)

Determine if a key exists in the settings data.

Parameters

string $key

Return Value

bool

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

at line 84
forget(string $key)

Unset a key in the settings data.

Parameters

string $key

at line 97
void forgetAll()

Unset all keys in the settings data.

Return Value

void

at line 107
array all()

Get all settings data.

Return Value

array

at line 118
void save()

Save any changes done to the settings data.

Return Value

void

at line 135
load(bool $force = false)

Make sure data is loaded.

Parameters

bool $force

Force a reload of data. Default false.

at line 147
abstract protected array read()

Read the data from the store.

Return Value

array

at line 156
abstract protected void write(array $data)

Write the data into the store.

Parameters

array $data

Return Value

void