Phraseanet PHP SDK API
Class

PhraseanetSDK\Http\APIResponse

class APIResponse

Response object from a Phraseanet API call

Methods

__construct(stdClass $response)

stdClass getResult()

Returns the result of the response

integer getStatusCode()

Returns the HTTP code

Boolean isOk()

Returns true is the response is successful

Boolean isEmpty()

Returns true if the response content is empty

string|null getErrorMessage()

Returns the error message

string|null getErrorDetails()

Returns error details

DateTime getResponseTime()

Returns the response datetime

string getUri()

Returns the requested URI

string getMethod()

Returns the requested method

string getCharset()

Returns the response charset

string getApiVersion()

Returns the API version

Boolean hasProperty(string $property)

Returns true if the response has the given property

Boolean getProperty(string $property)

Returns the response property, null if the property does not exist

Details

at line 30
public __construct(stdClass $response)

Parameters

stdClass $response

at line 45
public stdClass getResult()

Returns the result of the response

Return Value

stdClass

at line 55
public integer getStatusCode()

Returns the HTTP code

Return Value

integer

at line 65
public Boolean isOk()

Returns true is the response is successful

Return Value

Boolean

at line 75
public Boolean isEmpty()

Returns true if the response content is empty

Return Value

Boolean

at line 85
public string|null getErrorMessage()

Returns the error message

Return Value

string|null

at line 95
public string|null getErrorDetails()

Returns error details

Return Value

string|null

at line 105
public DateTime getResponseTime()

Returns the response datetime

Return Value

DateTime

at line 115
public string getUri()

Returns the requested URI

Return Value

string

at line 127
public string getMethod()

Returns the requested method

Return Value

string

at line 139
public string getCharset()

Returns the response charset

Return Value

string

at line 149
public string getApiVersion()

Returns the API version

Return Value

string

at line 161
public Boolean hasProperty(string $property)

Returns true if the response has the given property

Parameters

string $property The property name

Return Value

Boolean

at line 173
public Boolean getProperty(string $property)

Returns the response property, null if the property does not exist

Parameters

string $property The property name

Return Value

Boolean