TransportInterface
in
Interface for all transports
Tags
Table of Contents
- addRoute() : void
- Method adds's route
- fetchActions() : void
- Method fetches actions for routes
- getServiceLogics() : array<string|int, ServiceBaseLogic>
- Method returns list of user logics
- handleException() : void
- Method processes exception
- loadRoutes() : void
- Method loads routes
- loadRoutesFromConfig() : void
- Method loads routes from config file
- run() : void
- Method runs router
Methods
addRoute()
Method adds's route
public
addRoute(string $route, string $callback, string|array<string|int, mixed> $requestMethod[, string $callType = 'callLogic' ]) : void
Parameters
- $route : string
-
route
- $callback : string
-
logic method to be called
- $requestMethod : string|array<string|int, mixed>
-
HTTP request method
- $callType : string = 'callLogic'
-
type of the call
Return values
void —fetchActions()
Method fetches actions for routes
public
fetchActions(ServiceActionsInterface $actionsSource) : void
Parameters
- $actionsSource : ServiceActionsInterface
-
source of actions
Return values
void —getServiceLogics()
Method returns list of user logics
public
getServiceLogics() : array<string|int, ServiceBaseLogic>
Return values
array<string|int, ServiceBaseLogic> —handleException()
Method processes exception
public
handleException(Exception $e) : void
Parameters
- $e : Exception
-
Exception object
Return values
void —loadRoutes()
Method loads routes
public
loadRoutes(array<string|int, mixed> $routes) : void
Parameters
- $routes : array<string|int, mixed>
-
route descriptions
Return values
void —loadRoutesFromConfig()
Method loads routes from config file
public
loadRoutesFromConfig([string $path = './conf/routes.php' ]) : void
Parameters
- $path : string = './conf/routes.php'
-
path to the routes description
Return values
void —run()
Method runs router
public
run() : void