view->rowPlugin->entityManager->getViewBuilder($this->entityType->id()); /** @var \Drupal\views\ResultRow $row */ foreach ($result as $row) { // @todo Take relationships into account. // See https://www.drupal.org/node/2457999. $entity = $row->_entity; $entity->view = $this->view; $this->build[$entity->id()] = $view_builder->view($entity, $this->view->rowPlugin->options['view_mode'], $this->getLangcode($row)); } } /** * {@inheritdoc} */ public function render(ResultRow $row) { $entity_id = $row->_entity->id(); return $this->build[$entity_id]; } }