public function MailchimpEcommerceAdminSettings::submitForm in Mailchimp E-Commerce 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/ MailchimpEcommerceAdminSettings.php, line 62
Class
Namespace
Drupal\mailchimp_ecommerce\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = $this
->config('mailchimp_ecommerce.settings');
$settings = [
'mailchimp_ecommerce_store_name',
'mailchimp_ecommerce_list_id',
'mailchimp_ecommerce_store_id',
'mailchimp_ecommerce_integration',
];
foreach ($settings as $variable) {
if (isset($form[$variable]['#parents'])) {
$config
->set($variable, $form_state
->getValue($form[$variable]['#parents']));
}
}
$config
->save();
if (method_exists($this, '_submitForm')) {
$this
->_submitForm($form, $form_state);
}
parent::submitForm($form, $form_state);
}