dosamigos\google\maps\ClientAbstract::request PHP Метод

request() защищенный Метод

Makes the request to the Google API
protected request ( array $options = [] ) : mixed | null
$options array for the guzzle request
Результат mixed | null
    protected function request($options = [])
    {
        try {
            $params = array_filter($this->params);
            $response = $this->getClient()->get($this->getUrl(), ['query' => $params], $options);
            return $this->format == 'json' ? json_decode($response->getBody()) : simplexml_load_string($response->getBody());
        } catch (RequestException $e) {
            return null;
        }
    }

Usage Example

 /**
  * Makes a request for places nearby. Please, review the documentation on
  * https://developers.google.com/places/web-service/search#PlaceSearchResponses
  * for further information about the expected results.
  *
  * @param string $placeId Place ID
  * @param array $params parameters for the request. These override [GeocodingRequest::params].
  *
  * @return mixed|null
  * @throws \yii\base\InvalidConfigException
  */
 public function findPlaces(LatLng $location, $radius, $params = [])
 {
     $params['location'] = $location;
     $params['radius'] = $radius;
     $this->params = ArrayHelper::merge($this->params, $params);
     return parent::request();
 }
All Usage Examples Of dosamigos\google\maps\ClientAbstract::request