public function CustomBlockFormController::delete

Overrides \Drupal\Core\Entity\EntityFormController::delete().

Overrides EntityFormController::delete

File

drupal/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php, line 208
Contains \Drupal\custom_block\CustomBlockFormController.

Class

CustomBlockFormController
Form controller for the custom block edit forms.

Namespace

Drupal\custom_block

Code

public function delete(array $form, array &$form_state) {
  $destination = array();
  $query = \Drupal::request()->query;
  if (!is_null($query
    ->get('destination'))) {
    $destination = drupal_get_destination();
    $query
      ->remove('destination');
  }
  $block = $this
    ->buildEntity($form, $form_state);
  $form_state['redirect'] = array(
    'block/' . $block
      ->id() . '/delete',
    array(
      'query' => $destination,
    ),
  );
}