ConfirmDeleteMultiple::submitForm

public ConfirmDeleteMultiple::submitForm(array &$form, FormStateInterface $form_state)

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

core/modules/comment/src/Form/ConfirmDeleteMultiple.php, line 115

Class

ConfirmDeleteMultiple
Provides the comment multiple delete confirmation form.

Namespace

Drupal\comment\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  if ($form_state->getValue('confirm')) {
    $this->commentStorage->delete($this->comments);
    $count = count($form_state->getValue('comments'));
    $this->logger('content')->notice('Deleted @count comments.', array('@count' => $count));
    drupal_set_message($this->formatPlural($count, 'Deleted 1 comment.', 'Deleted @count comments.'));
  }
  $form_state->setRedirectUrl($this->getCancelUrl());
}
doc_Drupal
2016-10-29 08:55:29
Comments
Leave a Comment

Please login to continue.