Properties

$serviceLocator

$serviceLocator : \Pivot\Core\ReqRes\Pivot\Core\Services\ServiceLocator

Pivot Service Locator

Type

\Pivot\Core\ReqRes\Pivot\Core\Services\ServiceLocator

$appConfig

$appConfig : array

[$appConfig description]

Type

array

$relayBuilder

$relayBuilder : \Pivot\Core\ReqRes\Relay\RelayBuilder

Relay builder to call a midleware stack

Type

\Pivot\Core\ReqRes\Relay\RelayBuilder

$request

$request : object

PSR7 request object

Type

object

$response

$response : object

PSR7 Response object

Type

object

$routeName

$routeName : string

Name of the route to call

Type

string

$method

$method : string

HTTP method to use

Type

string

$params

$params : array

Array of params that would normally be in the route

Type

array

$data

$data : array

Data to be sent with a POST/PUT/PATCH

Type

array

Methods

__construct()

__construct(\Pivot\Core\Services\ServiceLocator  $serviceLocator, array  $appConfig, \Relay\RelayBuilder  $relayBuilder) 

Constructor

Parameters

\Pivot\Core\Services\ServiceLocator $serviceLocator
array $appConfig
\Relay\RelayBuilder $relayBuilder

call()

call(  $routeName = null,   $method = null,   $params = array(),   $data = array()) : Mixed

Call the resource

Parameters

$routeName
$method
$params
$data

Returns

Mixed —

(dto or ApiProblem)

post()

post(string  $routeName, array  $data) : \Pivot\Core\ReqRes\response

POSTs a dto to a resource, alias for $this->call

Parameters

string $routeName
array $data

POST body

Returns

\Pivot\Core\ReqRes\response

put()

put(string  $routeName, array  $data) : \Pivot\Core\ReqRes\response

PUTs a dto to a resource, alias for $this->call

Parameters

string $routeName
array $data

PUT body

Returns

\Pivot\Core\ReqRes\response

patch()

patch(string  $routeName, array  $data) : \Pivot\Core\ReqRes\response

PATCHes a dto to a resource, alias for $this->call

Parameters

string $routeName
array $data

PATCH body

Returns

\Pivot\Core\ReqRes\response

get()

get(string  $routeName, array  $params) : \Pivot\Core\ReqRes\response

GETs a dto from a resource, alias for $this->call

Parameters

string $routeName
array $params

URL params

Returns

\Pivot\Core\ReqRes\response

delete()

delete(string  $routeName, array  $params) : \Pivot\Core\ReqRes\response

DELETEs an entity from a resource, alias for $this->call

Parameters

string $routeName
array $params

URL params

Returns

\Pivot\Core\ReqRes\response

getRouteName()

getRouteName() : string

Get the value of Name of the route to call

Returns

string

setRouteName()

setRouteName(  $routeName) : self

Set the value of Name of the route to call

Parameters

$routeName

Returns

self

getMethod()

getMethod() : string

Get the value of HTTP method to use

Returns

string

setMethod()

setMethod(  $method) : self

Set the value of HTTP method to use

Parameters

$method

Returns

self

getParams()

getParams() : array

Get the value of Array of params that would normally be in the route

Returns

array

setParams()

setParams(array  $params) : self

Set the value of Array of params that would normally be in the route

Parameters

array $params

Returns

self

getData()

getData() : array

Get the value of Data to be sent with a POST/PUT/PATCH

Returns

array

setData()

setData(array  $data) : self

Set the value of Data to be sent with a POST/PUT/PATCH

Parameters

array $data

Returns

self

callResourceStack()

callResourceStack() : \Pivot\Core\ReqRes\$response

Calls the built middleware stack

Returns

\Pivot\Core\ReqRes\$response

buildStack()

buildStack() : void

Builds the middleware stack from config

callStack()

callStack() : \Pivot\Core\ReqRes\$response

Calls the built middleware stack

Returns

\Pivot\Core\ReqRes\$response