Esempio n. 1
0
 /**
  * Perform a GET request based on this model
  *
  * @param string $url
  * @param array $parameters
  * @param array $scopes
  * @param string $class The class type where the result should be casted to
  *
  * @return PatrolSdk\Model
  */
 protected function _get($url, $parameters = null, $scopes = [], $class = null)
 {
     $client = new HttpClient($this->patrol, 'get', $url, $parameters);
     $client->setScopes($scopes);
     $data = $client->response();
     if (isset($data['error'])) {
         $this->_error($data);
     }
     $data = $data['data'];
     $callee = $class ? $class : get_called_class();
     return Util::parseResponseToPatrolObject($this->patrol, $data, $callee, $this->defaults);
 }