CacheDecorator
class CacheDecorator implements PermissionRepository
Class CacheDecorator
Properties
protected PermissionRepository | $repo | PermissionRepository 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(PermissionRepository $repo, Repository $cache, int $minutes = 60)
CacheDecorator constructor.
findByName(string $siteKey, string $name)
Find a registered by type and name
int
array
fetchAncestor(string $siteKey, string $name)
Returns ancestor of item
array
fetchDescendant(string $siteKey, string $name)
Returns descendant of item
void
void
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 target name
string
getCacheKey(string $keyword)
String for cache key
Details
at line 76
__construct(PermissionRepository $repo, Repository $cache, int $minutes = 60)
CacheDecorator constructor.
at line 90
Permission
findByName(string $siteKey, string $name)
Find a registered by type and name
at line 105
Permission
insert(Permission $item)
Insert register information
at line 118
Permission
update(Permission $item)
Update register information
at line 131
int
delete(Permission $item)
Delete register information
at line 145
array
fetchAncestor(string $siteKey, string $name)
Returns ancestor of item
at line 161
array
fetchDescendant(string $siteKey, string $name)
Returns descendant of item
at line 177
void
foster(Permission $item, string $to)
Parent Changing with descendant
at line 192
void
affiliate(Permission $item, string $to)
affiliated to another registered
at line 207
protected array
getData(string $siteKey, string $head)
get cached data
at line 236
protected void
erase(string $siteKey, string $name)
Remove cache data
at line 250
private string
getHead(string $name)
parse name to head and segments
at line 264
protected string
makeKey(string $siteKey, string $name)
Make key by combination of site key and target name
at line 275
protected string
getCacheKey(string $keyword)
String for cache key