You are here

public function AddressFieldProvider::__construct in Geolocation Field 8.3

Same name and namespace in other branches
  1. 8.2 modules/geolocation_address/src/Plugin/geolocation/DataProvider/AddressFieldProvider.php \Drupal\geolocation_address\Plugin\geolocation\DataProvider\AddressFieldProvider::__construct()

AddressFieldProvider constructor.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager: Entity type manager.

\Drupal\geolocation\GeocoderManager $geocoder_manager: Geocoder Manager.

\CommerceGuys\Addressing\AddressFormat\AddressFormatRepositoryInterface $address_format_repository: The address format repository.

\CommerceGuys\Addressing\Country\CountryRepositoryInterface $country_repository: The country repository.

Throws

\Drupal\Component\Plugin\Exception\PluginException

Overrides DataProviderBase::__construct

File

modules/geolocation_address/src/Plugin/geolocation/DataProvider/AddressFieldProvider.php, line 78

Class

AddressFieldProvider
Provides default address field.

Namespace

Drupal\geolocation_address\Plugin\geolocation\DataProvider

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityFieldManagerInterface $entity_field_manager, GeocoderManager $geocoder_manager, AddressFormatRepositoryInterface $address_format_repository, CountryRepositoryInterface $country_repository) {
  parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_field_manager);
  $this->geocoderManager = $geocoder_manager;
  if (!empty($configuration['geocoder'])) {
    $this->geocoder = $this->geocoderManager
      ->createInstance($configuration['geocoder']);
  }
  $this->addressFormatRepository = $address_format_repository;
  $this->countryRepository = $country_repository;
}