PHP Class FactualResponse

This is a refactoring of the Factual Driver by Aaron: https://github.com/Factual/factual-java-driver
Author: Tyler
Afficher le fichier Open project: factual/factual-php-driver Class Usage Examples

Protected Properties

Свойство Type Description
$json string
$request
$responseCode
$responseHeaders table getting queried
$status string
$tableName
$version

Méthodes publiques

Méthode Description
__construct ( $apiResponse ) Constructor, parses return values from CURL in factual::request()
getCode ( ) : string Get http status code returned by Factual
getHeaders ( ) : string Get http headers returned by Factual
getJson ( ) : string Get the entire JSON response from Factual
getRawRequest ( ) : string Get url-encoded request string, does not include auth.
getRequest ( ) : string Get url-decoded request string, does not include auth.
getResponseCode ( ) : integer Get HTTP response code
getResponseHeaders ( ) : array Get response headers sent by Factual
getStatus ( ) : string Get the status returned by the Factual API server, e.g. "ok".
getTable ( ) : string Get table name queried
getVersion ( ) : numeric Get the version returned by the Factual API server, e.g. "3".
isEmpty ( ) : boolean Checks whether data was returned by Factual server. True if Factual's response did not include any results records for the query, false otherwise.
size ( ) : integer Gets count of elements returned in this page of result set (not total count)
success ( ) Test for success (200 status return) Note this tests for a successful http call, not a successful program operation
toString ( ) : string Subclasses of FactualResponse must provide access to the original JSON representation of Factual's response. Alias for getJson()

Méthodes protégées

Méthode Description
getTableName ( ) : string Gets table name call was made against
parseJSON ( $json ) : array Parses the server response from the API
parseResponse ( $apiResponse ) : void Parses the entire response from cURL, incl metadata

Method Details

__construct() public méthode

Constructor, parses return values from CURL in factual::request()
public __construct ( $apiResponse )

getCode() public méthode

Get http status code returned by Factual
public getCode ( ) : string
Résultat string

getHeaders() public méthode

Get http headers returned by Factual
public getHeaders ( ) : string
Résultat string

getJson() public méthode

Get the entire JSON response from Factual
public getJson ( ) : string
Résultat string

getRawRequest() public méthode

Get url-encoded request string, does not include auth.
public getRawRequest ( ) : string
Résultat string

getRequest() public méthode

Get url-decoded request string, does not include auth.
public getRequest ( ) : string
Résultat string

getResponseCode() public méthode

Get HTTP response code
public getResponseCode ( ) : integer
Résultat integer

getResponseHeaders() public méthode

Get response headers sent by Factual
public getResponseHeaders ( ) : array
Résultat array

getStatus() public méthode

Get the status returned by the Factual API server, e.g. "ok".
public getStatus ( ) : string
Résultat string

getTable() public méthode

Get table name queried
public getTable ( ) : string
Résultat string

getTableName() protected méthode

Gets table name call was made against
protected getTableName ( ) : string
Résultat string

getVersion() public méthode

Get the version returned by the Factual API server, e.g. "3".
public getVersion ( ) : numeric
Résultat numeric

isEmpty() public méthode

Checks whether data was returned by Factual server. True if Factual's response did not include any results records for the query, false otherwise.
public isEmpty ( ) : boolean
Résultat boolean

parseJSON() protected méthode

Parses the server response from the API
protected parseJSON ( $json ) : array
Résultat array structured JSON

parseResponse() protected méthode

Parses the entire response from cURL, incl metadata
protected parseResponse ( $apiResponse ) : void
Résultat void

size() public méthode

Gets count of elements returned in this page of result set (not total count)
public size ( ) : integer
Résultat integer

success() public méthode

Test for success (200 status return) Note this tests for a successful http call, not a successful program operation
public success ( )

toString() public méthode

Subclasses of FactualResponse must provide access to the original JSON representation of Factual's response. Alias for getJson()
public toString ( ) : string
Résultat string

Property Details

$json protected_oe property

string
protected $json

$request protected_oe property

protected $request

$responseCode protected_oe property

protected $responseCode

$responseHeaders protected_oe property

table getting queried
protected $responseHeaders

$status protected_oe property

string
protected $status

$tableName protected_oe property

protected $tableName

$version protected_oe property

protected $version