forum_node_predelete

forum_node_predelete(EntityInterface $node)

Implements hook_ENTITY_TYPE_predelete() for node entities.

File

core/modules/forum/forum.module, line 231
Provides discussion forums.

Code

function forum_node_predelete(EntityInterface $node) {
  if (\Drupal::service('forum_manager')->checkNodeType($node)) {
    /** @var \Drupal\forum\ForumIndexStorageInterface $forum_index_storage */
    $forum_index_storage = \Drupal::service('forum.index_storage');
    $forum_index_storage->delete($node);
    $forum_index_storage->deleteIndex($node);
  }
}
doc_Drupal
2016-10-29 09:17:18
Comments
Leave a Comment

Please login to continue.