class CacheDecorator implements ConfigRepository

저장소를 wrapping 하여 cache 에 있는 정보는 저장소에 요청되지 않고 cache 에서 반환 되도록 함

Properties

protected ConfigRepository $repo repository instance
protected Repository $cache cache instance
protected int $minutes expire time
protected string $prefix Prefix for cache key
protected array $bag memory cache

Methods

__construct(ConfigRepository $repo, Repository $cache, int $minutes = 60)

create instance

find(string $siteKey, string $name)

search getter

array
fetchAncestor(string $siteKey, string $name)

search ancestors getter

array
fetchDescendant(string $siteKey, string $name)

search descendants getter

void
clearLike(ConfigEntity $config, array $excepts = array())

clear all just descendants vars

void
remove(string $siteKey, string $name)

remove

void
foster(ConfigEntity $config, string $to)

Parent Changing with descendant

void
affiliate(ConfigEntity $config, string $to)

affiliated to another config

array
getData(string $siteKey, string $head)

get cached data

void
erase(string $siteKey, string $name)

Remove cache data

string
getHead(string $name)

parse name to head and segments

string
makeKey(string $siteKey, string $name)

Make key by combination of site key and config name

string
getCacheKey(string $keyword)

String for cache key

Details

at line 78
__construct(ConfigRepository $repo, Repository $cache, int $minutes = 60)

create instance

Parameters

ConfigRepository $repo repository instance
Repository $cache cache instance
int $minutes expire time

at line 92
ConfigEntity find(string $siteKey, string $name)

search getter

Parameters

string $siteKey site key
string $name the name

Return Value

ConfigEntity

at line 108
array fetchAncestor(string $siteKey, string $name)

search ancestors getter

Parameters

string $siteKey site key
string $name the name

Return Value

array

at line 124
array fetchDescendant(string $siteKey, string $name)

search descendants getter

Parameters

string $siteKey site key
string $name the name

Return Value

array

at line 139
ConfigEntity save(ConfigEntity $config)

save

Parameters

ConfigEntity $config config object

Return Value

ConfigEntity

at line 153
void clearLike(ConfigEntity $config, array $excepts = array())

clear all just descendants vars

Parameters

ConfigEntity $config config object
array $excepts target to the except

Return Value

void

at line 167
void remove(string $siteKey, string $name)

remove

Parameters

string $siteKey site key
string $name the name

Return Value

void

at line 181
void foster(ConfigEntity $config, string $to)

Parent Changing with descendant

Parameters

ConfigEntity $config config object
string $to to config prefix

Return Value

void

at line 196
void affiliate(ConfigEntity $config, string $to)

affiliated to another config

Parameters

ConfigEntity $config config object
string $to parent name

Return Value

void

at line 211
protected array getData(string $siteKey, string $head)

get cached data

Parameters

string $siteKey site key
string $head root name

Return Value

array

at line 240
protected void erase(string $siteKey, string $name)

Remove cache data

Parameters

string $siteKey site key
string $name config name

Return Value

void

at line 254
private string getHead(string $name)

parse name to head and segments

Parameters

string $name the name

Return Value

string

at line 268
protected string makeKey(string $siteKey, string $name)

Make key by combination of site key and config name

Parameters

string $siteKey site key
string $name config name

Return Value

string

at line 279
protected string getCacheKey(string $keyword)

String for cache key

Parameters

string $keyword keyword

Return Value

string