PHP Class Drahak\Restful\Application\RouteListFactory

Author: Drahomír Hanák
Inheritance: extends Nette\Object, implements Drahak\Restful\Application\IRouteListFactory
Datei anzeigen Open project: drahak/restful

Public Methods

Method Description
__construct ( string $presentersRoot, boolean $autoRebuild, Nette\Caching\IStorage $cacheStorage, Drahak\Restful\Application\RouteAnnotation $routeAnnotation )
create ( string | null $module = NULL ) : Drahak\Restful\Application\Routes\ResourceRouteList Create route list
setModule ( string $module ) : ResourceRoute Set default module of created routes
setPrefix ( string $prefix ) : RouteListFactory Set default routes URL mask prefix

Protected Methods

Method Description
addRoutes ( Drahak\Restful\Application\Routes\ResourceRouteList $routeList, array $routeData, string $className ) : Drahak\Restful\Application\Routes\ResourceRouteList Add class routes to route list
getClassMethods ( string $className ) : Method[] Get class methods
parseClassRoutes ( Method[] $methods ) : array Parse route annotations on given object methods

Private Methods

Method Description
getClassReflection ( string $className ) : ClassType Get class reflection

Method Details

__construct() public method

public __construct ( string $presentersRoot, boolean $autoRebuild, Nette\Caching\IStorage $cacheStorage, Drahak\Restful\Application\RouteAnnotation $routeAnnotation )
$presentersRoot string from where to find presenters
$autoRebuild boolean enable automatic rebuild of robot loader
$cacheStorage Nette\Caching\IStorage
$routeAnnotation Drahak\Restful\Application\RouteAnnotation

addRoutes() protected method

Add class routes to route list
protected addRoutes ( Drahak\Restful\Application\Routes\ResourceRouteList $routeList, array $routeData, string $className ) : Drahak\Restful\Application\Routes\ResourceRouteList
$routeList Drahak\Restful\Application\Routes\ResourceRouteList
$routeData array
$className string
return Drahak\Restful\Application\Routes\ResourceRouteList

create() final public method

Create route list
final public create ( string | null $module = NULL ) : Drahak\Restful\Application\Routes\ResourceRouteList
$module string | null
return Drahak\Restful\Application\Routes\ResourceRouteList

getClassMethods() protected method

Get class methods
protected getClassMethods ( string $className ) : Method[]
$className string
return Nette\Reflection\Method[]

parseClassRoutes() protected method

Parse route annotations on given object methods
protected parseClassRoutes ( Method[] $methods ) : array
$methods Nette\Reflection\Method[]
return array $data[URL mask][request method] = action name e.g. $data['api/v1/articles']['GET'] = 'read'

setModule() public method

Set default module of created routes
public setModule ( string $module ) : ResourceRoute
$module string
return Drahak\Restful\Application\Routes\ResourceRoute

setPrefix() public method

Set default routes URL mask prefix
public setPrefix ( string $prefix ) : RouteListFactory
$prefix string
return RouteListFactory