You are here

public function FeatureSettingsForm::submitForm in Ubercart 8.4

Same name in this branch
  1. 8.4 uc_file/src/Form/FeatureSettingsForm.php \Drupal\uc_file\Form\FeatureSettingsForm::submitForm()
  2. 8.4 uc_role/src/Form/FeatureSettingsForm.php \Drupal\uc_role\Form\FeatureSettingsForm::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

uc_role/src/Form/FeatureSettingsForm.php, line 217

Class

FeatureSettingsForm
Grants roles upon accepted payment of products.

Namespace

Drupal\uc_role\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $roles_config = $this
    ->config('uc_role.settings');
  $roles_config
    ->set('default_role', $form_state
    ->getValue('default_role'))
    ->set('default_role_choices', $form_state
    ->getValue('default_role_choices'))
    ->set('default_end_expiration', $form_state
    ->getValue('default_end_expiration'))
    ->set('default_length', $form_state
    ->getValue('default_length'))
    ->set('default_granularity', $form_state
    ->getValue('default_granularity'))
    ->set('default_end_time', $form_state
    ->getValue('default_end_time')
    ->getTimestamp())
    ->set('default_by_quantity', $form_state
    ->getValue('default_by_quantity'))
    ->set('reminder_length', $form_state
    ->getValue('reminder_length'))
    ->set('reminder_granularity', $form_state
    ->getValue('reminder_granularity'))
    ->set('default_show_expiration', $form_state
    ->getValue('default_show_expiration'))
    ->save();
  parent::submitForm($form, $form_state);
}