You are here

public function Provider::geocode in Geocoder 7.2

Geocode data

Parameters

string $data: The data to geocode.

Return value

AddressCollection|FALSE

Overrides ProviderInterface::geocode

1 method overrides Provider::geocode()
Random::geocode in src/Plugin/Geocoder/Provider/Random.php
Geocode data

File

src/Plugin/Geocoder/Provider.php, line 87
Contains \Drupal\geocoder\Plugin\Geocoder\Provider.

Class

Provider

Namespace

Drupal\geocoder\Plugin\Geocoder

Code

public function geocode($data) {
  $cid = $this
    ->getCacheCid($data);
  if ($value = $this
    ->cache_get($cid)) {
    return $value;
  }
  try {
    $value = $this
      ->getHandler()
      ->geocode($data);
  } catch (\Exception $e) {
    throw $e;
  } catch (\InvalidCredentials $e) {
    throw $e;
  }
  $this
    ->cache_set($cid, $value);
  return $value;
}