You are here

public function DateRecurInterpreterAddForm::validateForm in Recurring Dates Field 8.2

Same name and namespace in other branches
  1. 3.x src/Form/DateRecurInterpreterAddForm.php \Drupal\date_recur\Form\DateRecurInterpreterAddForm::validateForm()
  2. 3.0.x src/Form/DateRecurInterpreterAddForm.php \Drupal\date_recur\Form\DateRecurInterpreterAddForm::validateForm()
  3. 3.1.x src/Form/DateRecurInterpreterAddForm.php \Drupal\date_recur\Form\DateRecurInterpreterAddForm::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 DateRecurInterpreterEditForm::validateForm

File

src/Form/DateRecurInterpreterAddForm.php, line 60

Class

DateRecurInterpreterAddForm
Add form for date recur interpreter entities.

Namespace

Drupal\date_recur\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) : void {
  if (!isset($form['configure'])) {
    $form_state
      ->setRebuild();
  }
  else {
    $pluginType = $form_state
      ->getValue('plugin_type');
    $this
      ->getEntity()
      ->setPlugin($pluginType);
  }
}