You are here

public function AttributeEditForm::submitForm in Ubercart 8.4

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 FormInterface::submitForm

File

uc_attribute/src/Form/AttributeEditForm.php, line 36

Class

AttributeEditForm
Defines the attribute edit form.

Namespace

Drupal\uc_attribute\Form

Code

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

  // Remove Form API elements from $form_state.
  $form_state
    ->cleanValues();
  $this->database
    ->merge('uc_attributes')
    ->key([
    'aid' => $form_state
      ->getValue('aid'),
  ])
    ->fields($form_state
    ->getValues())
    ->execute();
  $form_state
    ->setRedirect('uc_attribute.overview');
}