function Rss::pre_render

Same name in this branch
  1. 9.x drupal/core/modules/node/lib/Drupal/node/Plugin/views/row/Rss.php \Drupal\node\Plugin\views\row\Rss::pre_render()
  2. 9.x drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/row/Rss.php \Drupal\comment\Plugin\views\row\Rss::pre_render()

Allow the style to do stuff before each row is rendered.

Parameters

$result: The full array of results from the query.

Overrides RowPluginBase::pre_render

File

drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/row/Rss.php, line 57
Definition of Drupal\comment\Plugin\views\row\Rss.

Class

Rss
Plugin which formats the comments as RSS items.

Namespace

Drupal\comment\Plugin\views\row

Code

function pre_render($result) {
  $cids = array();
  $nids = array();
  foreach ($result as $row) {
    $cids[] = $row->cid;
  }
  $this->comments = comment_load_multiple($cids);
  foreach ($this->comments as &$comment) {
    $comment->depth = count(explode('.', $comment->thread)) - 1;
    $nids[] = $comment->nid;
  }
  $this->nodes = node_load_multiple($nids);
}