You are here

public function EventSettingsForm::submitForm in RNG - Events and Registrations 8.2

Same name and namespace in other branches
  1. 8 src/Form/EventSettingsForm.php \Drupal\rng\Form\EventSettingsForm::submitForm()
  2. 3.x src/Form/EventSettingsForm.php \Drupal\rng\Form\EventSettingsForm::submitForm()

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

src/Form/EventSettingsForm.php, line 74

Class

EventSettingsForm
Configure event settings.

Namespace

Drupal\rng\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {

  /** @var \Drupal\Core\Entity\EntityInterface $event */
  $event = $form_state
    ->get('event');
  $form_state
    ->get('form_display')
    ->extractFormValues($event, $form, $form_state);
  $event
    ->save();
  $t_args = [
    '%event_label' => $event
      ->label(),
  ];
  drupal_set_message(t('Event settings updated.', $t_args));
}