You are here

function nodeorder_node_delete in Node Order 8

Same name and namespace in other branches
  1. 7 nodeorder.module \nodeorder_node_delete()

Implements hook_node_delete().

Handle lists in which the node is removed.

Related topics

File

./nodeorder.module, line 191
Nodeorder module.

Code

function nodeorder_node_delete(NodeInterface $node) {

  /** @var \Drupal\nodeorder\NodeOrderManagerInterface $nodeorder_manager */
  $nodeorder_manager = \Drupal::service('nodeorder.manager');

  // Get tids from node var; in the database they're already removed.
  $tids = $nodeorder_manager
    ->getOrderableTidsFromNode($node);
  foreach ($tids as $tid) {
    $nodeorder_manager
      ->handleListsDecrease($tid);
  }
}