You are here

public function GeocodeOrigin::validateOptionsForm in Geocoder 8.2

Same name and namespace in other branches
  1. 8.3 src/Plugin/GeofieldProximitySource/GeocodeOrigin.php \Drupal\geocoder\Plugin\GeofieldProximitySource\GeocodeOrigin::validateOptionsForm()

Validates the options form for the geofield proximity plugin.

Parameters

array $form: The form element to build.

\Drupal\Core\Form\FormStateInterface $form_state: The form state.

array $options_parents: The values parents.

Overrides GeofieldProximitySourceBase::validateOptionsForm

File

src/Plugin/GeofieldProximitySource/GeocodeOrigin.php, line 321

Class

GeocodeOrigin
Defines 'Geocode Origin (with Autocomplete option)' proximity source plugin.

Namespace

Drupal\geocoder\Plugin\GeofieldProximitySource

Code

public function validateOptionsForm(array &$form, FormStateInterface $form_state, array $options_parents) {
  $user_input = $form_state
    ->getUserInput();
  if (!empty($user_input['options']['source_configuration']['origin_address'])) {
    $this->origin = $this
      ->getAddressOrigin($user_input['options']['source_configuration']['origin_address']);
  }
}