You are here

function party_plugin_row_attached_entity::render in Party 7

Same name and namespace in other branches
  1. 8.2 includes/views/party_plugin_row_attached_entity.inc \party_plugin_row_attached_entity::render()

Render a row object. This usually passes through to a theme template of some form, but not always.

Parameters

stdClass $row: A single row of the query result, so an element of $view->result.

Return value

string The rendered output of a single row, used by the style plugin.

Overrides views_plugin_row::render

File

includes/views/party_plugin_row_attached_entity.inc, line 58
Row style plugin for displaying entities attached to a party. This will produce multiple rows per party, and is mostly intended for views which are filtered to a single party, thus showing a list of all of a party's attached entities.

Class

party_plugin_row_attached_entity
Plugin class for displaying party attached entities with entity_view.

Code

function render($result) {
  $entity_type = $result->{$this->field_alias_entity_type};
  $id = $result->{$this->field_alias_eid};
  $entity = $this->entities[$entity_type][$id];

  // Dose up the entity with the attaching party id, for our preprocess hook
  // party_preprocess_entity() to find.
  $party_id = $result->{$this->field_alias_pid};
  $entity->party_attaching_party = $party_id;
  $content = entity_view($entity_type, array(
    $id => $entity,
  ), 'party');
  return drupal_render($content);
}