public function EntityLabel::preRender in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/views/src/Plugin/views/field/EntityLabel.php \Drupal\views\Plugin\views\field\EntityLabel::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/ views/ src/ Plugin/ views/ field/ EntityLabel.php, line 123 - Contains \Drupal\views\Plugin\views\field\EntityLabel.
Class
- EntityLabel
- Field handler to display entity label optionally linked to entity page.
Namespace
Drupal\views\Plugin\views\fieldCode
public function preRender(&$values) {
parent::preRender($values);
$entity_ids_per_type = array();
foreach ($values as $value) {
if ($type = $this
->getValue($value, 'type')) {
$entity_ids_per_type[$type][] = $this
->getValue($value);
}
}
foreach ($entity_ids_per_type as $type => $ids) {
$this->loadedReferencers[$type] = $this->entityManager
->getStorage($type)
->loadMultiple($ids);
}
}