You are here

public function SupportTicketEntitySettingsForm::submitForm in Support Ticketing System 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

modules/support_ticket/src/Form/SupportTicketEntitySettingsForm.php, line 93
Contains \Drupal\config\Form\SupportTicketEntitySettingsForm.

Class

SupportTicketEntitySettingsForm
Defines the settings form for a support ticket entity.

Namespace

Drupal\support_ticket\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('diff.settings');
  $values = $form_state
    ->getValues();
  $support_ticket_base_fields = $this->entityManager
    ->getBaseFieldDefinitions('support_ticket');
  foreach ($support_ticket_base_fields as $field_key => $field) {
    $config
      ->set('entity.support_ticket' . '.' . $field_key, $values[$field_key]);
    $config
      ->save();
  }
  return parent::submitForm($form, $form_state);
}