function TaxonomyHooks::nodeUpdate

Same name and namespace in other branches
  1. 11.x core/modules/taxonomy/src/Hook/TaxonomyHooks.php \Drupal\taxonomy\Hook\TaxonomyHooks::nodeUpdate()

Implements hook_ENTITY_TYPE_update() for node entities.

Attributes

#[Hook('node_update')]

File

core/modules/taxonomy/src/Hook/TaxonomyHooks.php, line 146

Class

TaxonomyHooks
Hook implementations for taxonomy.

Namespace

Drupal\taxonomy\Hook

Code

public function nodeUpdate(EntityInterface $node) : void {
  // If we're not dealing with the default revision of the node, do not make
  // any change to the taxonomy index.
  if (!$node->isDefaultRevision()) {
    return;
  }
  $this->deleteNodeIndex($node);
  $this->buildNodeIndex($node);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.