FactualResponse::__construct PHP Method

__construct() public method

Constructor, parses return values from CURL in factual::request()
public __construct ( $apiResponse )
    public function __construct($apiResponse)
    {
        try {
            $this->json = $apiResponse['body'];
            $this->parseResponse($apiResponse);
        } catch (Exception $e) {
            //add note about json encoding borking here
            throw $e;
        }
    }

Usage Example

Esempio n. 1
0
 /**
  * Constructor, parses return values from CURL in factual::request() 
  * @param array response The JSON response String returned by Factual.
  */
 public function __construct($apiResponse, $responseTypes)
 {
     $this->responseTypes = $responseTypes;
     //pass response types from query. Do this before parent
     parent::__construct($apiResponse);
 }