\ServiceCommonLogic

Class stores all service's logic.

Summary

Methods
Properties
Constants
__construct()
connect()
set_token()
get_self_id()
get_self_login()
login_as()
get_self_id_value()
get_self_login_value()
$SecurityProvider
$ParamsFetcher
$Model
No constants found
get_param()
result()
has_permit()
validate_permit()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$ParamsFetcher

$ParamsFetcher : 

Request params fetcher.

Type

$Model

$Model : 

Model.

Type

Methods

__construct()

__construct(object  $ParamsFetcher, object  $SecurityProvider, mixed  $Model = null) 

Constructor.

Parameters

object $ParamsFetcher
  • Params fetcher.
object $SecurityProvider
  • Security provider.
mixed $Model
  • Service model.

connect()

connect() : array

Method creates connection.

Returns

array —

session id.

set_token()

set_token() : array

Method sets token.

Returns

array —

Session id.

get_self_id()

get_self_id() : integer

Method returns session user's id.

Returns

integer —

Session user's id.

get_self_login()

get_self_login() : string

Method returns session user's login.

Returns

string —

Session user's login.

login_as()

login_as() : array

Method allows to login under another user.

Returns

array —

Session id.

get_self_id_value()

get_self_id_value() : integer

Method returns self id.

Returns

integer —

Session user's id.

get_self_login_value()

get_self_login_value() : string

Method returns self login.

Returns

string —

Session user's login.

get_param()

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

Method returns request parameter.

Parameters

string $Param
  • parameter name.
mixed $Default
  • default value.

Returns

mixed —

Parameter value.

result()

result(mixed  $Value) : array

Method compiles result structure to be returned by endpoint.

Parameters

mixed $Value
  • Value to be returned.

Returns

array

has_permit()

has_permit(string  $Permit) : boolean

Checking does user has permit.

Parameters

string $Permit
  • Permit to check.

Returns

boolean —

true or false if the session user has permit or not.

validate_permit()

validate_permit(string  $Permit) 

The same as has_permit but throwing exception for session user no permit.

Parameters

string $Permit
  • Permit name.