PHP Class Xpressengine\Routing\Repositories\CacheDecorator

Author: XE Developers ([email protected])
Inheritance: implements Xpressengine\Routing\RouteRepository
Mostra file Open project: xpressengine/xpressengine

Protected Properties

Property Type Description
$cache Xpressengine\Support\CacheInterface Cache instance
$prefix string Prefix for cache key
$repo Xpressengine\Routing\RouteRepository Repository instance

Public Methods

Method Description
__construct ( Xpressengine\Routing\RouteRepository $repo, Xpressengine\Support\CacheInterface $cache ) CacheDecorator constructor.
all ( ) : InstanceRoute[] Returns all route items
create ( array $input ) : InstanceRoute Save a new route item and return the instance
delete ( InstanceRoute $route ) : boolean | null Delete the route item from the repository
fetchByModule ( string $module ) : InstanceRoute[] Retrieve routes by module name
fetchBySiteKey ( string $siteKey ) : InstanceRoute[] Retrieve routes by site key
findByInstanceId ( string $instanceId ) : InstanceRoute | null Retrieve a route by instance identifier
findByUrlAndSiteKey ( string $url, string $siteKey ) : InstanceRoute | null Retrieve a route by url segment and site key
put ( InstanceRoute $route ) : InstanceRoute Save the route item

Protected Methods

Method Description
cachingItem ( InstanceRoute $route ) : void Do caching a route item
getCacheKey ( string $keyword ) : string String for cache key

Method Details

__construct() public method

CacheDecorator constructor.
public __construct ( Xpressengine\Routing\RouteRepository $repo, Xpressengine\Support\CacheInterface $cache )
$repo Xpressengine\Routing\RouteRepository Repository instance
$cache Xpressengine\Support\CacheInterface Cache instance

all() public method

Returns all route items
public all ( ) : InstanceRoute[]
return Xpressengine\Routing\InstanceRoute[]

cachingItem() protected method

Do caching a route item
protected cachingItem ( InstanceRoute $route ) : void
$route Xpressengine\Routing\InstanceRoute route instance
return void

create() public method

Save a new route item and return the instance
public create ( array $input ) : InstanceRoute
$input array route item attributes
return Xpressengine\Routing\InstanceRoute

delete() public method

Delete the route item from the repository
public delete ( InstanceRoute $route ) : boolean | null
$route Xpressengine\Routing\InstanceRoute route instance
return boolean | null

fetchByModule() public method

Retrieve routes by module name
public fetchByModule ( string $module ) : InstanceRoute[]
$module string module name
return Xpressengine\Routing\InstanceRoute[]

fetchBySiteKey() public method

Retrieve routes by site key
public fetchBySiteKey ( string $siteKey ) : InstanceRoute[]
$siteKey string site key
return Xpressengine\Routing\InstanceRoute[]

findByInstanceId() public method

Retrieve a route by instance identifier
public findByInstanceId ( string $instanceId ) : InstanceRoute | null
$instanceId string instance identifier
return Xpressengine\Routing\InstanceRoute | null

findByUrlAndSiteKey() public method

Retrieve a route by url segment and site key
public findByUrlAndSiteKey ( string $url, string $siteKey ) : InstanceRoute | null
$url string first segment of url
$siteKey string site key
return Xpressengine\Routing\InstanceRoute | null

getCacheKey() protected method

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

put() public method

Save the route item
public put ( InstanceRoute $route ) : InstanceRoute
$route Xpressengine\Routing\InstanceRoute route instance
return Xpressengine\Routing\InstanceRoute

Property Details

$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 RouteRepository,Xpressengine\Routing $repo
return Xpressengine\Routing\RouteRepository