You are here

public function CommentDeleteSettingsForm::submitForm in Comment Delete 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 ConfigFormBase::submitForm

File

src/Form/CommentDeleteSettingsForm.php, line 89

Class

CommentDeleteSettingsForm
Form to configure comment delete settings.

Namespace

Drupal\comment_delete\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('comment_delete.config')
    ->set('default_selection', $form_state
    ->getValue('default'))
    ->set('soft', $form_state
    ->getValue('soft'))
    ->set('soft_mode', $form_state
    ->getValue('soft_mode'))
    ->set('soft_user', $form_state
    ->getValue('soft_user'))
    ->set('threshold', $form_state
    ->getValue('threshold'))
    ->set('message', $form_state
    ->getValue('message'))
    ->save();
  parent::submitForm($form, $form_state);
}