You are here

public function MailchimpAdminSettingsForm::submitForm in Mailchimp 8

Same name and namespace in other branches
  1. 2.x src/Form/MailchimpAdminSettingsForm.php \Drupal\mailchimp\Form\MailchimpAdminSettingsForm::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 ConfigFormBase::submitForm

File

src/Form/MailchimpAdminSettingsForm.php, line 175

Class

MailchimpAdminSettingsForm
Configure Mailchimp settings for this site.

Namespace

Drupal\mailchimp\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('mailchimp.settings');
  $config
    ->set('api_key', $form_state
    ->getValue('api_key'))
    ->set('api_timeout', $form_state
    ->getValue('api_timeout'))
    ->set('enable_connected', $form_state
    ->getValue('enable_connected'))
    ->set('connected_id', $form_state
    ->getValue('connected_id'))
    ->set('connected_paths', $form_state
    ->getValue('connected_paths'))
    ->set('cron', $form_state
    ->getValue('cron'))
    ->set('batch_limit', $form_state
    ->getValue('batch_limit'))
    ->set('webhook_hash', $form_state
    ->getValue('webhook_hash'))
    ->save();
  parent::submitForm($form, $form_state);
}