You are here

protected function ProviderUsingHandlerBase::getHandler in Geocoder 8.2

Same name and namespace in other branches
  1. 8.3 src/ProviderUsingHandlerBase.php \Drupal\geocoder\ProviderUsingHandlerBase::getHandler()

Returns the provider handler.

Return value

\Geocoder\Provider\Provider The provider plugin.

Throws

\ReflectionException

File

src/ProviderUsingHandlerBase.php, line 61

Class

ProviderUsingHandlerBase
Provides a base class for providers using handlers.

Namespace

Drupal\geocoder

Code

protected function getHandler() {
  if (!isset($this->handler)) {
    $definition = $this
      ->getPluginDefinition();
    $reflection_class = new \ReflectionClass($definition['handler']);
    $this->handler = $reflection_class
      ->newInstanceArgs($this
      ->getArguments());
  }
  return $this->handler;
}