You are here

function nodeorder_node_insert in Node Order 8

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

Implements hook_node_insert().

Handle the weights of the node in the taxonomy orderable lists it id added.

Related topics

File

./nodeorder.module, line 207
Nodeorder module.

Code

function nodeorder_node_insert(NodeInterface $node) {

  /** @var \Drupal\nodeorder\NodeOrderManagerInterface $nodeorder_manager */
  $nodeorder_manager = \Drupal::service('nodeorder.manager');
  $tids = $nodeorder_manager
    ->getOrderableTids($node, TRUE);
  foreach ($tids as $tid) {
    $nodeorder_manager
      ->addToList($node, $tid);
  }
}