You are here

public function IPRangesDeleteForm::submit in IP Ranges 8

File

lib/Drupal/ip_ranges/Form/IPRangesDeleteForm.php, line 41
Contains \Drupal\ip_ranges\Form\IPRangesDeleteForm

Class

IPRangesDeleteForm

Namespace

Drupal\ip_ranges\Form

Code

public function submit(array $form, array &$form_state) {
  $entity = $this->entity;
  $entity
    ->delete();
  watchdog('ip_ranges', 'Range deleted @range.', array(
    '@range' => $entity
      ->getIpDisplay(),
  ));
  drupal_set_message(t('Range @range has been deleted.', array(
    '@range' => $entity
      ->getIpDisplay(),
  )));
  $form_state['redirect_route']['route_name'] = 'ip_ranges.admin_list';
}