PHP Class Xpressengine\Routing\Repositories\DatabaseRouteRepository

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

Public Properties

Property Type Description
$protectedUrl array Protected keyword for url first segment

Protected Properties

Property Type Description
$configs Illuminate\Contracts\Config\Repository Laravel config instance
$model string The route model

Public Methods

Method Description
__construct ( Illuminate\Contracts\Config\Repository $configs, string $model ) DatabaseRouteRepository constructor.
all ( ) : InstanceRoute[] Returns all route items
create ( array $input ) : InstanceRoute Save a new route item and return the instance
createModel ( ) : Model Create a new instance of the model.
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 Retrieve a route by instance identifier
findByUrlAndSiteKey ( string $url, string $siteKey ) : InstanceRoute Retrieve a route by url segment and site key
getModel ( ) : string Gets the name of the Eloquent user model.
put ( InstanceRoute $route ) : InstanceRoute Save the route item
setModel ( string $model ) Sets the name of the Eloquent user model.

Protected Methods

Method Description
validateUrl ( string $siteKey, string $url, boolean $isNew ) : boolean Check validate given url

Method Details

__construct() public method

DatabaseRouteRepository constructor.
public __construct ( Illuminate\Contracts\Config\Repository $configs, string $model )
$configs Illuminate\Contracts\Config\Repository Laravel config instance
$model string The route model

all() public method

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

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

createModel() public method

Create a new instance of the model.
public createModel ( ) : Model
return Illuminate\Database\Eloquent\Model

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
$instanceId string instance identifier
return Xpressengine\Routing\InstanceRoute

findByUrlAndSiteKey() public method

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

getModel() public method

Gets the name of the Eloquent user model.
public getModel ( ) : string
return string

put() public method

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

setModel() public method

Sets the name of the Eloquent user model.
public setModel ( string $model )
$model string model class

validateUrl() protected method

Check validate given url
protected validateUrl ( string $siteKey, string $url, boolean $isNew ) : boolean
$siteKey string site key
$url string first segment of url
$isNew boolean if create new route then given true
return boolean

Property Details

$configs protected property

Laravel config instance
protected Repository,Illuminate\Contracts\Config $configs
return Illuminate\Contracts\Config\Repository

$model protected property

The route model
protected string $model
return string

$protectedUrl public property

Protected keyword for url first segment
public array $protectedUrl
return array