You are here

public function entity_views_plugin_row_entity_view::pre_render in Entity API 7

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

Parameters

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

Overrides views_plugin_row::pre_render

File

views/plugins/entity_views_plugin_row_entity_view.inc, line 70
Row style plugin for displaying the results as entities.

Class

entity_views_plugin_row_entity_view
Plugin class for displaying Views results with entity_view.

Code

public function pre_render($values) {
  if (!empty($values)) {
    list($this->entity_type, $this->entities) = $this->view->query
      ->get_result_entities($values, !empty($this->relationship) ? $this->relationship : NULL, isset($this->field_alias) ? $this->field_alias : NULL);
  }

  // Render the entities.
  if ($this->entities) {
    $render = entity_view($this->entity_type, $this->entities, $this->options['view_mode']);

    // Remove the first level of the render array.
    $this->rendered_content = reset($render);
  }
}