ConfigManager
class ConfigManager
Class ConfigManager
Properties
protected ConfigRepository | $repo | repository instance | |
protected Validator | $validator | validator instance | |
protected array | $closures | closure list |
Methods
create new config
returns config value
returns config pure value
returns config object by target name
if not exists, create new entity object by target name
set config value
multiple set config values
config change
remove config by group name
parse a key into group and item
sort list
Details
at line 63
__construct(ConfigRepository $repo, Validator $validator)
constructor
at line 78
ConfigEntity
add(string $group, array $collection, string $siteKey = 'default')
create new config
at line 107
mixed
getVal(string $key, mixed $default = null, bool $pure = false, string $siteKey = 'default')
returns config value
at line 132
mixed
getPureVal(string $key, mixed $default = null, string $siteKey = 'default')
returns config pure value
at line 145
ConfigEntity
get(string $group, bool $create = false, string $siteKey = 'default')
returns config object by target name
at line 168
ConfigEntity
getOrNew(string $group, string $siteKey = 'default')
if not exists, create new entity object by target name
at line 183
void
setVal(string $key, mixed $value, bool $toDesc = false, callable $filter = null, string $siteKey = 'default')
set config value
at line 209
ConfigEntity
set(string $group, array $collection, bool $toDesc = false, callable $filter = null, string $siteKey = 'default')
multiple set config values
at line 239
ConfigEntity
put(string $group, array $collection, bool $toDesc = false, callable $filter = null, string $siteKey = 'default')
config change
at line 266
ConfigEntity
modify(ConfigEntity $config)
modify config information
at line 283
protected ConfigEntity
share(ConfigEntity $config, string $item, mixed $value)
shared when closure value
at line 306
protected ConfigEntity
build(ConfigEntity $config)
build config object
at line 319
protected void
bindClosure(ConfigEntity $config)
binding registered closure to config
at line 339
protected void
convey(ConfigEntity $config, callable $filter = null, array $items = null)
convey to descendants
at line 370
void
remove(ConfigEntity $config)
remove config
at line 382
void
removeByName(string $name, string $siteKey = 'default')
remove config by group name
at line 395
array
children(ConfigEntity $config)
get next level configs
at line 418
private array
parseKey(string $key)
parse a key into group and item
at line 437
private ConfigEntity
setAncestors(ConfigEntity $config)
ancestors setter
at line 459
protected void
validating(ConfigEntity $config)
validation config
at line 475
private array
sort(array $configs, string $flag = 'asc')
sort list
at line 504
ConfigEntity
move(ConfigEntity $config, string|null $to = null)
Move entity hierarchy to new parent or root