You are here

public function ShrinkTheWebLogForm::submitForm in ShrinkTheWeb 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 FormInterface::submitForm

File

src/Form/ShrinkTheWebLogForm.php, line 104

Class

ShrinkTheWebLogForm

Namespace

Drupal\shrinktheweb\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $log_recs = array_filter($form_state
    ->getValue('log_records'));
  $num_deleted = \Drupal::database()
    ->delete('shrinktheweb_log')
    ->condition('stw_siteid', $log_recs, 'IN')
    ->execute();
  drupal_set_message(t('@num_deleted log records deleted successful', array(
    '@num_deleted' => $num_deleted,
  )));
}