You are here

protected function Random::doGeocode in Geocoder 8.2

Same name and namespace in other branches
  1. 8.3 src/Plugin/Geocoder/Provider/Random.php \Drupal\geocoder\Plugin\Geocoder\Provider\Random::doGeocode()

Performs the geocoding.

Parameters

string $source: The data to be geocoded.

Return value

\Geocoder\Model\AddressCollection|\Geometry|null The Address, NULL otherwise.

Overrides ProviderBase::doGeocode

File

src/Plugin/Geocoder/Provider/Random.php, line 36

Class

Random
Class Random.

Namespace

Drupal\geocoder\Plugin\Geocoder\Provider

Code

protected function doGeocode($source) {
  return $this
    ->getAddressFactory()
    ->createFromArray([
    $this
      ->getRandomResult(),
  ]);
}