Core/RestCalls/SyncRestHandler.phpView Source

Show: PublicProtectedPrivateinherited
Table of Contents
Package
Default  

\SyncRestHandler

Package: Default
SyncRestHandler contains the logic for preparing the REST request, calls REST services and returns the response.
Parent(s)
\RestHandler
Inherited_from
\RestHandler  

Properties

>VPropertyprivate\ICompressor $RequestCompressor
Gets or sets Request compressor.
Details
Type
\ICompressor
>VPropertyprivate\IEntitySerializer $RequestSerializer
Gets or sets Request serializer.
Details
Type
\IEntitySerializer
>VPropertyprivate\ICompressor $ResponseCompressor
Gets or sets Response compressor.
Details
Type
\ICompressor
>VPropertyprivate\IEntitySerializer $ResponseSerializer
Response serializer.
Details
Type
\IEntitySerializer
>VPropertyprivate\ServiceContext $serviceContext
The context
Details
Type
\ServiceContext
Inherited_from
\RestHandler::serviceContext  
>VPropertyprivate\ServiceContext $serviceContext
The contex
Details
Type
\ServiceContext

Methods

methodprivateCallRestService(\RequestParameters $requestParameters, string $requestBody, string $oauthRequestUri) : array

Calls the rest service.

Parameters
NameTypeDescription
$requestParameters\RequestParameters

The parameters

$requestBodystring

The request body

$oauthRequestUristring

The OAuth request uri

Returns
TypeDescription
arrayelements are 0: HTTP response code; 1: HTTP response body
methodprivateGetOAuthResponseHeaders(\OAuth $oauth) : array

Returns the response headers, response body and response code from a called OAuth object

Parameters
NameTypeDescription
$oauth\OAuth

A called OAuth object

Returns
TypeDescription
arrayelements are 0: HTTP response code; 1: response content, 2: HTTP response headers
methodpublicGetResponse(\ServiceContext $requestParameters, string $requestBody, string $oauthRequestUri) : array

Returns the response by calling REST service.

Parameters
NameTypeDescription
$requestParameters\ServiceContext

The parameters

$requestBodystring

The request body

$oauthRequestUristring

The OAuth request uri

Returns
TypeDescription
arrayelements are 0: HTTP response code; 1: HTTP response body
methodpublicGetResponseSyncRest(\RequestParameters $requestParameters, string $requestBody, string $oauthRequestUri) : void

Returns the response by calling REST service.

Parameters
NameTypeDescription
$requestParameters\RequestParameters

The parameters

$requestBodystring

The request body

$oauthRequestUristring

The OAuth request uri

methodpublicSyncRestHandler(\ServiceContext $context) : void

Initializes a new instance of the SyncRestHandler class.

Parameters
NameTypeDescription
$context\ServiceContext

The context

methodprotected__construct(\ServiceContext $context) : void
inherited

Initializes a new instance of the RestHandler class.

Inherited from:
Parameters
NameTypeDescription
$context\ServiceContext

The Service Context

methodprivategenerateErrorFromOAuthException( $exception) : void

Parameters
NameTypeDescription
$exception
methodprivategetAcceptContentType(\type $value) : string

Accept anything if content type is not XML or Json

Parameters
NameTypeDescription
$value\type
Returns
TypeDescription
string
methodpublicgetLastError() : void

Return an representation of an error returned by the last request, or false if the last request was not an error.

methodprivatequeryToArray( $qry) : void

Parameters
NameTypeDescription
$qry
Documentation was generated by phpDocumentor 2.8.5.