public function SettingsForm::submitForm

File

src/Form/SettingsForm.php, line 158

Class

SettingsForm
Configure tmgmt settings.

Namespace

Drupal\tmgmt\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('tmgmt.settings')
    ->set('quick_checkout', $form_state
    ->getValue('tmgmt_quick_checkout'))
    ->set('purge_finished', $form_state
    ->getValue('tmgmt_purge_finished'))
    ->set('anonymous_access', $form_state
    ->getValue('tmgmt_anonymous_access'))
    ->set('respect_text_format', $form_state
    ->getValue('respect_text_format'))
    ->set('allowed_formats', array_keys(array_filter($form_state
    ->getValue('allowed_formats'))))
    ->set('submit_job_item_on_cron', $form_state
    ->getValue('tmgmt_submit_job_item_on_cron'))
    ->set('job_items_cron_limit', $form_state
    ->getValue('job_items_cron_limit'))
    ->set('file_mimetypes', array_values(array_filter($form_state
    ->getValue('mimetypes', []))))
    ->save();
  parent::submitForm($form, $form_state);
}