You are here

public function DepthDeleteDataForm::submitForm in Taxonomy Term Depth 8.2

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

src/Form/DepthDeleteDataForm.php, line 44

Class

DepthDeleteDataForm

Namespace

Drupal\taxonomy_term_depth\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $query = \Drupal::database()
    ->update('taxonomy_term_field_data')
    ->fields([
    'depth_level' => NULL,
  ])
    ->execute();
  $this
    ->messenger()
    ->addMessage($this
    ->t('Taxonomy depth fields\' columns has been deleted.'));
}