You are here

public function NodeImportController::snpDeleteNode in Simple Node Importer 8

Function to abort the import.

1 string reference to 'NodeImportController::snpDeleteNode'
simple_node_importer.routing.yml in ./simple_node_importer.routing.yml
simple_node_importer.routing.yml

File

src/Controller/NodeImportController.php, line 474

Class

NodeImportController
Default controller for the simple_node_importer module.

Namespace

Drupal\simple_node_importer\Controller

Code

public function snpDeleteNode($option, $node) {
  if ($node) {
    $storage_handler = \Drupal::entityTypeManager()
      ->getStorage("node");
    $entity = $storage_handler
      ->load($node);
    $storage_handler
      ->delete([
      $entity,
    ]);
    $response = new RedirectResponse('/node/add/simple_node');
    return $response
      ->send();
  }
}