class SettingsManager implements SettingsStorage

Class SettingsManager.

Manages the retrieval and storage of settings using the database and cache.

Properties

protected string $cacheTag

The cache tag used for settings.

Methods

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

Get a setting value.

void
set(string $key, mixed $value = null)

Set a setting value.

bool
has(string $key)

Check if a setting exists.

array
all()

Get all settings.

bool
databaseHasTable()

Check if the settings table exists in the database.

string
inferType(mixed $value)

Infer the type of a value.

Details

at line 31
mixed get(string $key, mixed $default = null)

Get a setting value.

Parameters

string $key

The setting key.

mixed $default

The default value.

Return Value

mixed

at line 56
void set(string $key, mixed $value = null)

Set a setting value.

Parameters

string $key

The setting key.

mixed $value

The setting value.

Return Value

void

at line 86
bool has(string $key)

Check if a setting exists.

Parameters

string $key

The setting key.

Return Value

bool

at line 96
array all()

Get all settings.

Return Value

array

at line 110
protected bool databaseHasTable()

Check if the settings table exists in the database.

Return Value

bool

at line 126
protected string inferType(mixed $value)

Infer the type of a value.

Parameters

mixed $value

Return Value

string