class SettingRepository implements SettingContract

system config Setting Repository

Traits

Key 解析器 解析 key 字串到 namespace, group 和 item.

AppTrait

Properties

protected array $keyParserCache

解析的缓存存储 这里的命名方式, 因为是在 trait 中使用 所以这里的缓存的命名前面加上了 trait 的前缀 keyParser

from  KeyParserTrait
protected Resp $error error from  AppTrait
protected Resp $success success from  AppTrait

Methods

setParsedKey(string $key, array $parsed)

根据 key 设置值

bool
keyParserMatch(string $key)

Check Key valid

array
parseKey(string $key)

解析 key 至 namespace, group, and item.

array
keyParserParseBasicSegments(array $segments)

解析数值中的基本片段并且返回可用的数组

array
keyParserParseSegments(string $key)

解析一系列命名空间的片段

getError()

获取错误

from  AppTrait
bool
setError(string|MessageBag $error)

设置错误

from  AppTrait
getSuccess()

Get success messages;

from  AppTrait
bool
setSuccess(Resp|string $success)

No description

from  AppTrait
__construct()

No description

bool
delete(string $key)

No description

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

No description

bool
set(string $key, mixed $value = '')

No description

array
getNG(string $ng)

根据命名空间从数据库中获取数据

bool
removeNG(string $ng)

删除命名空间以及分组

void
clear()

No description

Details

in KeyParserTrait at line 27
KeyParserTrait setParsedKey(string $key, array $parsed)

根据 key 设置值

Parameters

string $key key
array $parsed parsed

Return Value

KeyParserTrait

in KeyParserTrait at line 38
bool keyParserMatch(string $key)

Check Key valid

Parameters

string $key key

Return Value

bool

in KeyParserTrait at line 52
array parseKey(string $key)

解析 key 至 namespace, group, and item.

Parameters

string $key key

Return Value

array

in KeyParserTrait at line 81
protected array keyParserParseBasicSegments(array $segments)

解析数值中的基本片段并且返回可用的数组

Parameters

array $segments segments

Return Value

array

in KeyParserTrait at line 103
protected array keyParserParseSegments(string $key)

解析一系列命名空间的片段

Parameters

string $key key

Return Value

array

in AppTrait at line 32
Resp getError()

获取错误

Return Value

Resp

in AppTrait at line 45
bool setError(string|MessageBag $error)

设置错误

Parameters

string|MessageBag $error error

Return Value

bool

in AppTrait at line 82
Resp getSuccess()

Get success messages;

Return Value

Resp

in AppTrait at line 100
bool setSuccess(Resp|string $success)

No description

Parameters

Resp|string $success 设置的成功信息

Return Value

bool

at line 40
__construct()

No description

at line 52
bool delete(string $key)

No description

Parameters

string $key

key need delete

Return Value

bool

Exceptions

SettingKeyNotMatchException
Exception

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

No description

Parameters

string $key 获取设置key
null $default 默认值

Return Value

mixed

Exceptions

SettingKeyNotMatchException
SettingValueOutOfRangeException

at line 107
bool set(string $key, mixed $value = '')

No description

Parameters

string $key 获取设置key
mixed $value 需要设置的值

Return Value

bool

Exceptions

SettingKeyNotMatchException
SettingValueOutOfRangeException

at line 148
array getNG(string $ng)

根据命名空间从数据库中获取数据

Parameters

string $ng 命名空间和分组

Return Value

array

at line 168
bool removeNG(string $ng)

删除命名空间以及分组

Parameters

string $ng

Return Value

bool

at line 198
void clear()

No description

Return Value

void