PHP Class Xpressengine\Config\Repositories\CacheDecorator

Author: XE Team (developers) ([email protected])
Inheritance: extends Xpressengine\Config\Repositories\AbstractDecorator
Exibir arquivo Open project: xpressengine/xpressengine Class Usage Examples

Protected Properties

Property Type Description
$bag array memory cache
$cache Xpressengine\Support\CacheInterface cache instance
$prefix string Prefix for cache key
$repo Xpressengine\Config\ConfigRepository repository instance

Public Methods

Method Description
__construct ( Xpressengine\Config\ConfigRepository $repo, Xpressengine\Support\CacheInterface $cache ) create instance
affiliate ( ConfigEntity $config, string $to ) : void affiliated to another config
clearLike ( ConfigEntity $config, array $excepts = [] ) : void clear all just descendants vars
fetchAncestor ( string $siteKey, string $name ) : array search ancestors getter
fetchDescendant ( string $siteKey, string $name ) : array search descendants getter
find ( string $siteKey, string $name ) : ConfigEntity search getter
foster ( ConfigEntity $config, string $to ) : void Parent Changing with descendant
remove ( string $siteKey, string $name ) : void remove
save ( ConfigEntity $config ) : ConfigEntity save

Protected Methods

Method Description
erase ( string $siteKey, string $name ) : void Remove cache data
getCacheKey ( string $keyword ) : string String for cache key
getData ( string $siteKey, string $head ) : array get cached data
makeKey ( string $siteKey, string $name ) : string Make key by combination of site key and config name

Private Methods

Method Description
getHead ( string $name ) : array parse name to head and segments

Method Details

__construct() public method

create instance
public __construct ( Xpressengine\Config\ConfigRepository $repo, Xpressengine\Support\CacheInterface $cache )
$repo Xpressengine\Config\ConfigRepository repository instance
$cache Xpressengine\Support\CacheInterface cache instance

affiliate() public method

affiliated to another config
public affiliate ( ConfigEntity $config, string $to ) : void
$config Xpressengine\Config\ConfigEntity config object
$to string parent name
return void

clearLike() public method

clear all just descendants vars
public clearLike ( ConfigEntity $config, array $excepts = [] ) : void
$config Xpressengine\Config\ConfigEntity config object
$excepts array target to the except
return void

erase() protected method

Remove cache data
protected erase ( string $siteKey, string $name ) : void
$siteKey string site key
$name string config name
return void

fetchAncestor() public method

search ancestors getter
public fetchAncestor ( string $siteKey, string $name ) : array
$siteKey string site key
$name string the name
return array

fetchDescendant() public method

search descendants getter
public fetchDescendant ( string $siteKey, string $name ) : array
$siteKey string site key
$name string the name
return array

find() public method

search getter
public find ( string $siteKey, string $name ) : ConfigEntity
$siteKey string site key
$name string the name
return Xpressengine\Config\ConfigEntity

foster() public method

Parent Changing with descendant
public foster ( ConfigEntity $config, string $to ) : void
$config Xpressengine\Config\ConfigEntity config object
$to string to config prefix
return void

getCacheKey() protected method

String for cache key
protected getCacheKey ( string $keyword ) : string
$keyword string keyword
return string

getData() protected method

get cached data
protected getData ( string $siteKey, string $head ) : array
$siteKey string site key
$head string root name
return array

makeKey() protected method

Make key by combination of site key and config name
protected makeKey ( string $siteKey, string $name ) : string
$siteKey string site key
$name string config name
return string

remove() public method

remove
public remove ( string $siteKey, string $name ) : void
$siteKey string site key
$name string the name
return void

save() public method

save
public save ( ConfigEntity $config ) : ConfigEntity
$config Xpressengine\Config\ConfigEntity config object
return Xpressengine\Config\ConfigEntity

Property Details

$bag protected_oe property

memory cache
protected array $bag
return array

$cache protected_oe property

cache instance
protected CacheInterface,Xpressengine\Support $cache
return Xpressengine\Support\CacheInterface

$prefix protected_oe property

Prefix for cache key
protected string $prefix
return string

$repo protected_oe property

repository instance
protected ConfigRepository,Xpressengine\Config $repo
return Xpressengine\Config\ConfigRepository