You are here

protected function GeocoderApiEnpoints::setGeocodersOptions in Geocoder 8.3

Same name and namespace in other branches
  1. 8.2 src/Controller/GeocoderApiEnpoints.php \Drupal\geocoder\Controller\GeocoderApiEnpoints::setGeocodersOptions()

Set Geocoders Options.

Merges Geocoders Options from Request Query and Module Configurations.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The Request object.

Return value

array The merged Plugins Options array.

2 calls to GeocoderApiEnpoints::setGeocodersOptions()
GeocoderApiEnpoints::geocode in src/Controller/GeocoderApiEnpoints.php
GeocoderApiEnpoints::reverseGeocode in src/Controller/GeocoderApiEnpoints.php

File

src/Controller/GeocoderApiEnpoints.php, line 85

Class

GeocoderApiEnpoints
Class GeocoderApiEnpoints.

Namespace

Drupal\geocoder\Controller

Code

protected function setGeocodersOptions(Request $request) : array {

  // Retrieve geocoders options from the module configurations.
  $geocoders_configs = $this->config
    ->get('plugins_options') ?: [];

  // Get possible query string specific geocoders options.
  $geocoders_options = $request
    ->get('options') ?: [];

  // Merge geocoders options.
  $options = NestedArray::mergeDeep($geocoders_configs, $geocoders_options);
  return $options;
}