\ServiceConsoleTransport

Console transport for all services

Summary

Methods
Properties
Constants
__construct()
create_session()
add_route()
load_route()
load_routes()
load_routes_from_config()
call_logic()
call_public_logic()
error_response()
get_param()
run()
get_params_fetcher()
$ParamsFetcher
$ServiceLogic
$Router
$SecurityProvider
No constants found
get_necessary_logic()
format_call_stack()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$ParamsFetcher

$ParamsFetcher : \HTTPRequestParams

Request params fetcher

Type

\HTTPRequestParams

$ServiceLogic

$ServiceLogic : \ServiceLogic

Service's logic

Type

\ServiceLogic

$Router

$Router : \Router

Router

Type

\Router

$SecurityProvider

$SecurityProvider : \ServiceSecurityProvider

Security provider

Type

\ServiceSecurityProvider — Provider of the securitty routines

Methods

__construct()

__construct(\ServiceSecurityProvider  $SecurityProvider = 'ServiceMockSecurityProvider') 

Constructor

Parameters

\ServiceSecurityProvider $SecurityProvider

Security provider

create_session()

create_session(boolean|string  $Token = '') 

Method creates session

Parameters

boolean|string $Token

Session token

add_route()

add_route(string  $Route, string  $Method, string  $Request, string  $CallType = 'call_logic') 

Method adds's route

Parameters

string $Route

Route

string $Method

Logic method to be called

string $Request

HTTP request method

string $CallType

Type of the call

load_route()

load_route(array  $Route) 

Method loads single route

Parameters

array $Route

Route description

load_routes()

load_routes(array  $Routes) 

Method loads routes

Parameters

array $Routes

Route descriptions

load_routes_from_config()

load_routes_from_config(string  $Path = './conf/routes.php') 

Method loads routes from config file

Parameters

string $Path

Path to the routes description

call_logic()

call_logic(\ServiceLogic  $ServiceLogic, string  $Method, array  $Params = array()) : mixed

Method runs logic functions

Parameters

\ServiceLogic $ServiceLogic

object with all service logic

string $Method

Logic's method to be executed

array $Params

Logic's parameters

Returns

mixed —

Result of the called method

call_public_logic()

call_public_logic(\ServiceLogic  $ServiceLogic, string  $Method, array  $Params = array()) : mixed

Method runs logic functions

Parameters

\ServiceLogic $ServiceLogic

object with all service logic

string $Method

Logic's method to be executed

array $Params

Logic's parameters

Returns

mixed —

Result of the called method

error_response()

error_response(mixed  $e) : array

Error response compilator

Parameters

mixed $e

Exception object

Returns

array —

Error data

get_param()

get_param(string  $Param, mixed  $Default = false) : string

Method returns parameter

Parameters

string $Param

Parameter name

mixed $Default

Default value

Returns

string —

Parameter value

run()

run() 

Method runs router

get_params_fetcher()

get_params_fetcher() : \HTTPRequestParams

Method constructs request data fetcher

Returns

\HTTPRequestParams

Request data fetcher

get_necessary_logic()

get_necessary_logic(string  $Method) : \ServiceLogic

Method searches necessary logic object

Parameters

string $Method

Necessary method

Returns

\ServiceLogic

Logic object

format_call_stack()

format_call_stack(mixed  $e) : array

Formatting call stack

Parameters

mixed $e

Exception object

Returns

array —

Call stack