function TaxonomyHooks::deleteNodeIndex

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

Deletes taxonomy index entries for a given node.

Parameters

\Drupal\Core\Entity\EntityInterface $node: The node entity.

2 calls to TaxonomyHooks::deleteNodeIndex()
TaxonomyHooks::nodePredelete in core/modules/taxonomy/src/Hook/TaxonomyHooks.php
Implements hook_ENTITY_TYPE_predelete() for node entities.
TaxonomyHooks::nodeUpdate in core/modules/taxonomy/src/Hook/TaxonomyHooks.php
Implements hook_ENTITY_TYPE_update() for node entities.

File

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

Class

TaxonomyHooks
Hook implementations for taxonomy.

Namespace

Drupal\taxonomy\Hook

Code

protected function deleteNodeIndex(EntityInterface $node) : void {
  if (\Drupal::config('taxonomy.settings')->get('maintain_index_table')) {
    \Drupal::database()->delete('taxonomy_index')
      ->condition('nid', $node->id())
      ->execute();
  }
}

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