function NodeSearchHooks::commentUpdate
Implements hook_ENTITY_TYPE_update() for comment entities.
Attributes
#[Hook('comment_update')]
File
-
core/
modules/ node/ src/ Hook/ NodeSearchHooks.php, line 41
Class
- NodeSearchHooks
- Hook implementations for node entity operations.
Namespace
Drupal\node\HookCode
public function commentUpdate($comment) : void {
// Reindex the node when comments are changed.
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.