You are here

public function EventSeriesUpdateConfirmForm::submitForm in Booking and Availability Management Tools for Drupal 8

Form submission 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 FormInterface::submitForm

File

modules/bat_event_series/src/Entity/Form/EventSeriesUpdateConfirmForm.php, line 94
Contains \Drupal\bat_event_series\Entity\Form\EventSeriesUpdateConfirmForm.

Class

EventSeriesUpdateConfirmForm

Namespace

Drupal\bat_event_series\Entity\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  if ($form_state
    ->getValue('confirm')) {
    $this->bat_event_series
      ->save();
    $this
      ->messenger()
      ->addMessage($this
      ->t('Saved the %label Event series.', [
      '%label' => $this->bat_event_series
        ->label(),
    ]));
    $form_state
      ->setRedirect('entity.bat_event_series.edit_form', [
      'bat_event_series' => $this->bat_event_series
        ->id(),
    ]);
  }
}