function NodeSearchHooks::commentDelete
Same name and namespace in other branches
- 11.x core/modules/node/src/Hook/NodeSearchHooks.php \Drupal\node\Hook\NodeSearchHooks::commentDelete()
Implements hook_ENTITY_TYPE_delete() for comment entities.
Attributes
#[Hook('comment_delete')]
File
-
core/
modules/ node/ src/ Hook/ NodeSearchHooks.php, line 123
Class
- NodeSearchHooks
- Search related hook implementations for node module.
Namespace
Drupal\node\HookCode
public function commentDelete($comment) : void {
// Reindex the node when comments are deleted.
if ($comment->getCommentedEntityTypeId() == 'node') {
$this->reindexNodeForSearch($comment->getCommentedEntityId());
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.