\Service

Service class.

It bounds together transport, request parameters fetcher, logic, authorization and model.

Summary

Methods
Properties
Constants
__construct()
run()
launch()
$SessionId
$ServiceTransport
$ServiceLogic
No constants found
init_transport()
construct_service_logic()
init_service_logic()
init_common_routes()
init_custom_routes()
init_routes()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$SessionId

$SessionId : \string.

Session Id.

Type

\string.

$ServiceTransport

$ServiceTransport : object

Service's ransport.

Type

object — Service transport object.

$ServiceLogic

$ServiceLogic : \ServiceLogic

Service's logic.

Type

\ServiceLogic — object.

Methods

__construct()

__construct(mixed  $ServiceTransport = 'ServiceRESTTransport', mixed  $SecurityProvider = 'ServiceMockSecurityProvider',   $ServiceLogic = 'ServiceCommonLogic', mixed  $ServiceModel = 'ServiceModel') 

Constructor.

Parameters

mixed $ServiceTransport
  • Service's transport.
mixed $SecurityProvider
  • Service's security provider;
$ServiceLogic
mixed $ServiceModel

- Service's model.

run()

run() 

Running $this->ServiceTransport run loop.

launch()

launch(\Service|string  $Service, \ServiceTransport|string  $ServiceTransport = 'ServiceRESTTransport',   $SecurityProvider = 'ServiceMockSecurityProvider', \ServiceCommonLogic  $ServiceLogic = 'ServiceCommonLogic', \ServiceModel  $ServiceModel = 'ServiceModel', boolean  $RunService = true) : \Service

Method launches service.

Parameters

\Service|string $Service
  • name of the service class or the service object itself.
\ServiceTransport|string $ServiceTransport
  • name of the service transport class or the service transport itself.
$SecurityProvider
\ServiceCommonLogic $ServiceLogic
  • Logic of the service.
\ServiceModel $ServiceModel
  • Model of the service.
boolean $RunService
  • Shold be service lanched.

Returns

\Service

Created service.

init_transport()

init_transport(mixed  $ServiceTransport, mixed  $SecurityProvider) 

Method inits service's transport.

Parameters

mixed $ServiceTransport
  • Service's transport;
mixed $SecurityProvider
  • Service's security provider.

construct_service_logic()

construct_service_logic(mixed  $ServiceLogic, mixed  $ServiceModel) : \Service

Method constructs service logic if necessary.

Parameters

mixed $ServiceLogic
  • Service logic class name of object itself;
mixed $ServiceModel
  • Service model class name of object itself;

Returns

\Service

logic object.

init_service_logic()

init_service_logic(mixed  $ServiceLogic, mixed  $ServiceModel) 

Method inits service's logic.

Parameters

mixed $ServiceLogic
  • Service's logic.
mixed $ServiceModel
  • Service's Model.

init_common_routes()

init_common_routes() 

Method inits common servoce's routes.

init_custom_routes()

init_custom_routes() 

Method inits custom routes if necessary.

init_routes()

init_routes() 

Method inits service's routes.