Service/Twitter/Response.php
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
- Version
- $Id$
\Zend_Service_Twitter_Response
Package: Zend_Service\Twitter
Throws
Returns
Throws
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
Methods
__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.
ParametersName | Type | Description |
---|---|---|
$httpResponse | \Zend_Http_Response |
Exception | Description |
---|---|
\Zend_Service_Twitter_Exception | if unable to decode JSON response |
__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.
ParametersName | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
mixed |
getErrors() : 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.
ReturnsType | Description |
---|---|
array |
Exception | Description |
---|---|
\Exception\DomainException | if unable to detect structure of error response |