PHP Class Xpressengine\Permission\Repositories\CacheDecorator

Author: XE Developers ([email protected])
Inheritance: implements Xpressengine\Permission\PermissionRepository
Mostrar archivo Open project: xpressengine/xpressengine

Protected Properties

Property Type Description
$bag array memory cache
$cache Xpressengine\Support\CacheInterface Cache instance
$prefix string Prefix for cache key
$repo Xpressengine\Permission\PermissionRepository PermissionRepository instance

Public Methods

Method Description
__construct ( Xpressengine\Permission\PermissionRepository $repo, Xpressengine\Support\CacheInterface $cache ) CacheDecorator constructor.
affiliate ( Permission $item, string $to ) : void affiliated to another registered
delete ( Permission $item ) : integer Delete register information
fetchAncestor ( string $siteKey, string $name ) : array Returns ancestor of item
fetchDescendant ( string $siteKey, string $name ) : array Returns descendant of item
findByName ( string $siteKey, string $name ) : Permission Find a registered by type and name
foster ( Permission $item, string $to ) : void Parent Changing with descendant
insert ( Permission $item ) : Permission Insert register information
update ( Permission $item ) : Permission Update register information

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 target name

Private Methods

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

Method Details

__construct() public method

CacheDecorator constructor.
public __construct ( Xpressengine\Permission\PermissionRepository $repo, Xpressengine\Support\CacheInterface $cache )
$repo Xpressengine\Permission\PermissionRepository PermissionRepository instance
$cache Xpressengine\Support\CacheInterface Cache instance

affiliate() public method

affiliated to another registered
public affiliate ( Permission $item, string $to ) : void
$item Xpressengine\Permission\Permission permission instance
$to string parent name
return void

delete() public method

Delete register information
public delete ( Permission $item ) : integer
$item Xpressengine\Permission\Permission permission instance
return integer affecting statement

erase() protected method

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

fetchAncestor() public method

Returns ancestor of item
public fetchAncestor ( string $siteKey, string $name ) : array
$siteKey string site key
$name string target name
return array

fetchDescendant() public method

Returns descendant of item
public fetchDescendant ( string $siteKey, string $name ) : array
$siteKey string site key
$name string target name
return array

findByName() public method

Find a registered by type and name
public findByName ( string $siteKey, string $name ) : Permission
$siteKey string site key
$name string target name
return Xpressengine\Permission\Permission

foster() public method

Parent Changing with descendant
public foster ( Permission $item, string $to ) : void
$item Xpressengine\Permission\Permission permission instance
$to string parent name
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

insert() public method

Insert register information
public insert ( Permission $item ) : Permission
$item Xpressengine\Permission\Permission permission instance
return Xpressengine\Permission\Permission

makeKey() protected method

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

update() public method

Update register information
public update ( Permission $item ) : Permission
$item Xpressengine\Permission\Permission permission instance
return Xpressengine\Permission\Permission

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

PermissionRepository instance
protected PermissionRepository,Xpressengine\Permission $repo
return Xpressengine\Permission\PermissionRepository