forum_node_storage_load

forum_node_storage_load($nodes)

Implements hook_ENTITY_TYPE_storage_load() for node entities.

File

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

Code

function forum_node_storage_load($nodes) {
  $node_vids = array();
  foreach ($nodes as $node) {
    if (\Drupal::service('forum_manager')->checkNodeType($node)) {
      $node_vids[] = $node->getRevisionId();
    }
  }
  if (!empty($node_vids)) {
    $result = \Drupal::service('forum.index_storage')->read($node_vids);
    foreach ($result as $record) {
      $nodes[$record->nid]->forum_tid = $record->tid;
    }
  }
}
doc_Drupal
2016-10-29 09:17:19
Comments
Leave a Comment

Please login to continue.