CacheDecorator
class CacheDecorator implements RouteRepository
Class CacheDecorator
Properties
protected RouteRepository | $repo | Repository instance | |
protected Repository | $cache | Cache instance | |
protected int | $minutes | expire time | |
protected string | $prefix | Prefix for cache key |
Methods
__construct(RouteRepository $repo, Repository $cache, int $minutes = 60)
CacheDecorator constructor.
all()
Returns all route items
InstanceRoute|null
findByUrlAndSiteKey(string $url, string $siteKey)
Retrieve a route by url segment and site key
void
InstanceRoute|null
findByInstanceId(string $instanceId)
Retrieve a route by instance identifier
fetchBySiteKey(string $siteKey)
Retrieve routes by site key
fetchByModule(string $module)
Retrieve routes by module name
create(array $input)
Save a new route item and return the instance
bool|null
string
getCacheKey(string $keyword)
String for cache key
Details
at line 68
__construct(RouteRepository $repo, Repository $cache, int $minutes = 60)
CacheDecorator constructor.
at line 80
InstanceRoute[]
all()
Returns all route items
at line 103
InstanceRoute|null
findByUrlAndSiteKey(string $url, string $siteKey)
Retrieve a route by url segment and site key
at line 124
protected void
cachingItem(InstanceRoute $route)
Do caching a route item
at line 136
InstanceRoute|null
findByInstanceId(string $instanceId)
Retrieve a route by instance identifier
at line 157
InstanceRoute[]
fetchBySiteKey(string $siteKey)
Retrieve routes by site key
at line 179
InstanceRoute[]
fetchByModule(string $module)
Retrieve routes by module name
at line 201
InstanceRoute
create(array $input)
Save a new route item and return the instance
at line 215
InstanceRoute
put(InstanceRoute $route)
Save the route item
at line 229
bool|null
delete(InstanceRoute $route)
Delete the route item from the repository
at line 243
protected string
getCacheKey(string $keyword)
String for cache key