You are here

public function PardotSettingsForm::submitForm in Pardot Integration 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/PardotSettingsForm.php, line 182

Class

PardotSettingsForm
Configure Pardot settings for this site.

Namespace

Drupal\Pardot\Form

Code

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

  // Submit condition plugin configurations.
  $this->path_condition
    ->submitConfigurationForm($form, $form_state);
  $this->user_role_condition
    ->submitConfigurationForm($form, $form_state);

  // Save configuration to settings.
  $this
    ->config('pardot.settings')
    ->set('account_id', Html::escape($form_state
    ->getValue('account_id')))
    ->set('default_campaign_id', Html::escape($form_state
    ->getValue('default_campaign_id')))
    ->set('path_condition', $this->path_condition
    ->getConfiguration())
    ->set('user_role_condition', $this->user_role_condition
    ->getConfiguration())
    ->save();
  parent::submitForm($form, $form_state);
}