RestApiGenerator
in package
Class RestApiGenerator
Table of Contents
Properties
- $entityActions : array<string|int, RestRouteGenerator>
- $entityPath : string
- $itemActions : array<string|int, RestRouteGenerator>
- $routePrefix : string
Methods
- __construct() : mixed
- RestApiGenerator constructor.
- generateEntityRoutes() : void
- generateRoute() : array<string|int, mixed>
- getAllActions() : array<string|int, mixed>
- getApiConfig() : object
- getEntityActions() : array<string|int, RestRouteGenerator>
- getEntityPath() : string
- getFullItemPath() : string
- getItemActions() : array<string|int, RestRouteGenerator>
- getItemPath() : string
- getRawConfig() : array<string|int, mixed>
- getRoutes() : array<string|int, mixed>
- isValidCallable() : bool
- isValidSource() : bool
Properties
$entityActions
private
array<string|int, RestRouteGenerator>
$entityActions
$entityPath
private
string
$entityPath
$itemActions
private
array<string|int, RestRouteGenerator>
$itemActions
$routePrefix
private
string
$routePrefix
= 'api_'
Methods
__construct()
RestApiGenerator constructor.
public
__construct([string $entityPath = '/%s' ]) : mixed
Parameters
- $entityPath : string = '/%s'
generateEntityRoutes()
public
generateEntityRoutes(array<string|int, mixed> &$routes, object $api, string $routePrefix, string $entityPath, object $entityConfig[, object|null $alias = null ]) : void
Parameters
- $routes : array<string|int, mixed>
- $api : object
- $routePrefix : string
- $entityPath : string
- $entityConfig : object
- $alias : object|null = null
generateRoute()
public
generateRoute(string $actionKey, RestRouteGenerator $action, string $path, object $entityConfig, object|null $alias, array<string|int, mixed>|null $parent) : array<string|int, mixed>
Parameters
- $actionKey : string
- $action : RestRouteGenerator
- $path : string
- $entityConfig : object
- $alias : object|null
- $parent : array<string|int, mixed>|null
Return values
array<string|int, mixed>getAllActions()
public
getAllActions() : array<string|int, mixed>
Return values
array<string|int, mixed>getApiConfig()
public
getApiConfig() : object
Tags
Return values
objectgetEntityActions()
public
getEntityActions() : array<string|int, RestRouteGenerator>
Return values
array<string|int, RestRouteGenerator>getEntityPath()
public
getEntityPath() : string
Return values
stringgetFullItemPath()
public
getFullItemPath() : string
Return values
stringgetItemActions()
public
getItemActions() : array<string|int, RestRouteGenerator>
Return values
array<string|int, RestRouteGenerator>getItemPath()
public
getItemPath() : string
Return values
stringgetRawConfig()
public
getRawConfig() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getRoutes()
public
getRoutes([string|null $endpoint = null ]) : array<string|int, mixed>
Parameters
- $endpoint : string|null = null
Tags
Return values
array<string|int, mixed>isValidCallable()
protected
isValidCallable(string $callable) : bool
Parameters
- $callable : string
Return values
boolisValidSource()
protected
isValidSource(string $source) : bool
Parameters
- $source : string