Service/Twitter/Response.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework
LICENSE This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Service  
Subpackage
Twitter  
Version
$Id$  

\Zend_Service_Twitter_Response

Package: Zend_Service\Twitter
Representation of a response from Twitter.
Provides: - method for testing if we have a successful call - method for retrieving errors, if any - method for retrieving the raw JSON - method for retrieving the decoded response - proxying to elements of the decoded response via property overloading
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotected\Zend_Http_Response $httpResponse
>VPropertyprotectedarray|\stdClass $jsonBody
Details
Type
array | \stdClass
>VPropertyprotectedstring $rawBody
Details
Type
string

Methods

methodpublic__construct(\Zend_Http_Response $httpResponse) : void

Constructor

Assigns the HTTP response to a property, as well as the body representation. It then attempts to decode the body as JSON.
Parameters
NameTypeDescription
$httpResponse\Zend_Http_Response
Throws
ExceptionDescription
\Zend_Service_Twitter_Exceptionif unable to decode JSON response
methodpublic__get(string $name) : mixed

Property overloading to JSON elements

If a named property exists within the JSON response returned, proxies to it. Otherwise, returns null.
Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
mixed
methodpublicgetErrors() : array

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
TypeDescription
array
Throws
ExceptionDescription
\Exception\DomainExceptionif unable to detect structure of error response
methodpublicgetRawResponse() : string

Retrieve the raw response body

Returns
TypeDescription
string
methodpublicisError() : bool

Did an error occur in the request?

Returns
TypeDescription
bool
methodpublicisSuccess() : bool

Was the request successful?

Returns
TypeDescription
bool
methodpublictoValue() : array | \stdClass

Retun the decoded response body

Returns
TypeDescription
array | \stdClass
Documentation was generated by phpDocumentor 2.2.0 .