You are here

public function ControlElementBase::validateSettingsForm in Geolocation Field 8.3

Same name in this branch
  1. 8.3 modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlElementBase.php \Drupal\geolocation_google_maps\Plugin\geolocation\MapFeature\ControlElementBase::validateSettingsForm()
  2. 8.3 modules/geolocation_yandex/src/Plugin/geolocation/MapFeature/ControlElementBase.php \Drupal\geolocation_yandex\Plugin\geolocation\MapFeature\ControlElementBase::validateSettingsForm()
  3. 8.3 modules/geolocation_leaflet/src/Plugin/geolocation/MapFeature/ControlElementBase.php \Drupal\geolocation_leaflet\Plugin\geolocation\MapFeature\ControlElementBase::validateSettingsForm()
Same name and namespace in other branches
  1. 8.2 modules/geolocation_yandex/src/Plugin/geolocation/MapFeature/ControlElementBase.php \Drupal\geolocation_yandex\Plugin\geolocation\MapFeature\ControlElementBase::validateSettingsForm()

Validate Feature Form.

Parameters

array $values: Feature values.

\Drupal\Core\Form\FormStateInterface $form_state: Form State.

array $parents: Element parents.

Overrides MapFeatureBase::validateSettingsForm

File

modules/geolocation_yandex/src/Plugin/geolocation/MapFeature/ControlElementBase.php, line 48

Class

ControlElementBase
Class ControlMapFeatureBase.

Namespace

Drupal\geolocation_yandex\Plugin\geolocation\MapFeature

Code

public function validateSettingsForm(array $values, FormStateInterface $form_state, array $parents) {
  if (!in_array($values['position'], array_keys(Yandex::getControlPositions()))) {
    $form_state
      ->setErrorByName(implode('][', $parents), $this
      ->t('No valid position.'));
  }
}