Zend Framework  1.12
Public Member Functions | Protected Attributes | List of all members
Zend_Service_Twitter_Response Class Reference

Public Member Functions

 __construct (Zend_Http_Response $httpResponse)
 Constructor.
 
 __get ($name)
 Property overloading to JSON elements.
 
 isSuccess ()
 Was the request successful?
 
 isError ()
 Did an error occur in the request?
 
 getErrors ()
 Retrieve the errors.
 
 getRawResponse ()
 Retrieve the raw response body.
 
 toValue ()
 Retun the decoded response body.
 

Protected Attributes

 $httpResponse
 
 $jsonBody
 
 $rawBody
 

Constructor & Destructor Documentation

__construct ( Zend_Http_Response  $httpResponse)

Constructor.

Assigns the HTTP response to a property, as well as the body representation. It then attempts to decode the body as JSON.

Parameters
Zend_Http_Response$httpResponse
Exceptions
Zend_Service_Twitter_Exceptionif unable to decode JSON response

Member Function Documentation

__get (   $name)

Property overloading to JSON elements.

If a named property exists within the JSON response returned, proxies to it. Otherwise, returns null.

Parameters
string$name
Returns
mixed
getErrors ( )

Retrieve the errors.

Twitter _should_ return a standard error object, which contains an "errors" property pointing to an array of errors. This method will return that array if present, and raise an exception if not detected.

If the response was successful, an empty array is returned.

Returns
array
Exceptions
Exception\DomainExceptionif unable to detect structure of error response
getRawResponse ( )

Retrieve the raw response body.

Returns
string
isError ( )

Did an error occur in the request?

Returns
bool
isSuccess ( )

Was the request successful?

Returns
bool
toValue ( )

Retun the decoded response body.

Returns
array|stdClass

Member Data Documentation

$httpResponse
protected
$jsonBody
protected
$rawBody
protected