You are here

protected function ProviderBase::getCacheId in Geocoder 8.3

Same name and namespace in other branches
  1. 8.2 src/ProviderBase.php \Drupal\geocoder\ProviderBase::getCacheId()

Builds a cached id.

Parameters

string $method: The method: 'geocode' or 'reverse'.

array $data: An array with data to be processed. When geocoding, it contains only one item with the string. When reversing, contains 2 items: the latitude and the longitude.

Return value

string An unique cache id.

1 call to ProviderBase::getCacheId()
ProviderBase::process in src/ProviderBase.php
Provides a helper callback for geocode() and reverse().

File

src/ProviderBase.php, line 160

Class

ProviderBase
Provides a base class for providers using handlers.

Namespace

Drupal\geocoder

Code

protected function getCacheId($method, array $data) : string {
  $cid = [
    $method,
    $this
      ->getPluginId(),
  ];
  $cid[] = sha1(serialize($this->configuration) . serialize($data));
  return implode(':', $cid);
}