You are here

public function EntityLink::preRender in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/comment/src/Plugin/views/field/EntityLink.php \Drupal\comment\Plugin\views\field\EntityLink::preRender()

Runs before any fields are rendered.

This gives the handlers some time to set up before any handler has been rendered.

Parameters

\Drupal\views\ResultRow[] $values: An array of all ResultRow objects returned from the query.

Overrides FieldPluginBase::preRender

File

core/modules/comment/src/Plugin/views/field/EntityLink.php, line 61
Contains \Drupal\comment\Plugin\views\field\EntityLink.

Class

EntityLink
Handler for showing comment module's entity links.

Namespace

Drupal\comment\Plugin\views\field

Code

public function preRender(&$values) {

  // Render all nodes, so you can grep the comment links.
  $entities = array();
  foreach ($values as $row) {
    $entity = $row->_entity;
    $entities[$entity
      ->id()] = $entity;
  }
  if ($entities) {
    $this->build = entity_view_multiple($entities, $this->options['teaser'] ? 'teaser' : 'full');
  }
}