You are here

function entity_hierarchy_node_update in Entity Reference Hierarchy 8

Implements This function will be called whenever a node is updated. We will write the hierarchy information to the database if a parent is set on the node edit form or delete the parent if a checkbox is selected.

See also

hook_ENTITY_TYPE_update().

HierarchyManagerInterface::hierarchySaveNode

File

./entity_hierarchy.module, line 196
A module to make nodes hierarchical.

Code

function entity_hierarchy_node_update(EntityInterface $node) {
  $hierarchy_manager = \Drupal::service('entity_hierarchy.manager');
  $hierarchy_manager
    ->hierarchySaveNode($node);
}