You are here

public function SynonymForm::validateForm in Synonyms 8

Same name and namespace in other branches
  1. 2.0.x src/Form/SynonymForm.php \Drupal\synonyms\Form\SynonymForm::validateForm()

Form validation handler.

Parameters

array $form: An associative array containing the structure of the form.

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

Overrides FormBase::validateForm

File

src/Form/SynonymForm.php, line 217

Class

SynonymForm
Entity form for 'synonym' config entity type.

Namespace

Drupal\synonyms\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  parent::validateForm($form, $form_state);
  if ($this->entity
    ->getProviderPluginInstance() instanceof PluginFormInterface) {
    $this->entity
      ->getProviderPluginInstance()
      ->validateConfigurationForm($form['ajax_wrapper']['provider_configuration'], $this
      ->getSubFormState('provider_configuration', $form, $form_state));
  }
  if ($this->entity
    ->getProviderPluginInstance()
    ->getBehaviorServiceInstance() instanceof SynonymsBehaviorConfigurableInterface) {
    $this->entity
      ->getProviderPluginInstance()
      ->getBehaviorServiceInstance()
      ->validateConfigurationForm($form['ajax_wrapper']['behavior_configuration'], $this
      ->getSubFormState('behavior_configuration', $form, $form_state), $this->entity);
  }
}