You are here

protected function Random::doGeocode in Geocoder 8.3

Same name and namespace in other branches
  1. 8.2 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 collection, or the geometry, or NULL.

Overrides ProviderBase::doGeocode

File

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

Class

Random
Class Random.

Namespace

Drupal\geocoder\Plugin\Geocoder\Provider

Code

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