DatabaseSettingStore
class DatabaseSettingStore 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 |
protected DatabaseManager | $db | The database connection instance. |
|
protected Repository | $cache | The cache instance. |
|
protected | $cacheKey | ||
protected string | $table | The table to query from. |
|
protected string | $keyColumn | The key column name to query from. |
|
protected string | $valueColumn | The value column name to query from. |
|
protected Closure|null | $queryConstraint | Any query constraints that should be applied. |
|
protected array | $extraColumns | Any extra columns that should be added to the rows. |
Methods
Get a specific key from the settings data.
Set a specific key to a value in the settings data.
Unset a key in the settings data.
Read the data from the store.
Write the data into the store.
No description
Set the table to query from.
Set the key column name to query from.
Set the value column name to query from.
Set extra columns to be added to the rows.
Transforms settings data into an array ready to be insterted into the database. Call array_dot on a multidimensional array before passing it into this method!
Parse data coming from the database.
Create a new query builder instance.
No description
No description
No description
No description
No description
No description
Details
in
SettingStore at line 35
mixed
get(string|array $key, mixed $default = null)
Get a specific key from the settings data.
in
SettingStore at line 49
bool
has(string $key)
Determine if a key exists in the settings data.
in
SettingStore at line 62
set(string|array $key, mixed $value = null)
Set a specific key to a value in the settings data.
at line 122
forget(string $key)
Unset a key in the settings data.
in
SettingStore at line 97
void
forgetAll()
Unset all keys in the settings data.
in
SettingStore at line 107
array
all()
Get all settings data.
in
SettingStore at line 118
void
save()
Save any changes done to the settings data.
in
SettingStore at line 135
load(bool $force = false)
Make sure data is loaded.
at line 224
protected array
read()
Read the data from the store.
at line 148
protected void
write(array $data)
Write the data into the store.
at line 61
__construct(DatabaseManager $db, Repository $cache)
No description
at line 72
setTable(string $table)
Set the table to query from.
at line 82
setKeyColumn($keyColumn)
Set the key column name to query from.
at line 92
setValueColumn($valueColumn)
Set the value column name to query from.
at line 102
setConstraint(Closure $callback)
Set the query constraint.
at line 114
setExtraColumns(array $columns)
Set extra columns to be added to the rows.
at line 200
protected array
prepareInsertData(array $data)
Transforms settings data into an array ready to be insterted into the database. Call array_dot on a multidimensional array before passing it into this method!
at line 243
protected array
parseReadData(Collection $data)
Parse data coming from the database.
at line 273
protected Builder
newQuery($insert = false)
Create a new query builder instance.
at line 291
protected
parseKeyValue($value)
No description
at line 301
protected
parseInsertKeyValue($value)
No description
at line 313
mixed
getCacheKey()
No description
at line 321
setCacheKey(mixed $cacheKey)
No description
at line 326
flushCache()
No description
at line 334
protected
cacheCallback(Closure $callback)
No description
at line 342
protected
hasDatabase()
No description