protected function query($yql)
    {
        $params = $this->urlParams;
        $params['q'] = $yql;
        $url = $this->url . '?' . http_build_query($params);

        // query the API
        try {
            $response = $this->guzzle->request('GET', $url);
        } catch (TransferException $e) {
            throw new ConnectionException($e->getMessage());
        }

        // process response
        $response = json_decode($response->getBody(), true);

        if (isset($response['query']) && isset($response['query']['results'])) {
            return $response['query']['results'];
        } else {
            throw new ResponseException('Response body is malformed.');
        }
    }
protected function query($yql)
    {
        $params = $this->urlParams;
        $params['q'] = $yql;
        $url = $this->url . '?' . http_build_query($params);

        // query the API
        try {
            $response = $this->guzzle->request('GET', $url);
        } catch (TransferException $e) {
            throw new ConnectionException($e->getMessage());
        }

        // process response
        $response = json_decode($response->getBody(), true);

        if (isset($response['query']) && isset($response['query']['results'])) {
            return $response['query']['results'];
        } else {
            throw new ResponseException('Response body is malformed.');
        }
    }
protected function query ( $ yql ) { $ params = $ this -> urlParams ; $ params [ 'q' ] = $ yql ; $ url = $ this -> url . '?' . http_build_query ( $ params ) ; // query the API try { $ response = $ this -> guzzle -> request ( 'GET' , $ url ) ; } catch ( TransferException $ e ) { throw new ConnectionException ( $ e -> getMessage ( ) ) ; } // process response $ response = json_decode ( $ response -> getBody ( ) , true ) ; if ( isset ( $ response [ 'query' ] ) && isset ( $ response [ 'query' ] [ 'results' ] ) ) { return $ response [ 'query' ] [ 'results' ] ; } else { throw new ResponseException ( 'Response body is malformed.' ) ; } }
Perform the API query and return results as an array.

@param  string $yql YQL query to send.
@return array
Perform the API query and return results as an array .