You are here

private function views_aggregator_plugin_style_table::get_cell_raw in Views Aggregator Plus 7

Returns the raw, unrendered result at the intersection of column and row.

Should normally not be called, especially not for Math Expr. or PHP fields.

Parameters

object $field_handler: The handler associated with the result column being requested.

object $result_row: The result row.

bool $compressed: If the result is a (nested) array, return the first primitive value.

Return value

string the raw contents of the cell

1 call to views_aggregator_plugin_style_table::get_cell_raw()
views_aggregator_plugin_style_table::get_cell in views/views_aggregator_plugin_style_table.inc
Returns the raw or rendered result at the intersection of column and row.

File

views/views_aggregator_plugin_style_table.inc, line 516
views_aggregator_plugin_style_table.inc

Class

views_aggregator_plugin_style_table
Style plugin to render each item as a row in a table.

Code

private function get_cell_raw($field_handler, $result_row, $compressed = TRUE) {
  $field_name = 'field_' . $field_handler->options['id'];
  if (isset($result_row->{$field_name})) {
    $value = reset($result_row->{$field_name});
    $value = isset($value['raw']) ? $value['raw'] : $value;
  }
  elseif (isset($result_row->{$field_handler->field_alias})) {

    // nid, node_title etc.
    $value = $result_row->{$field_handler->field_alias};
  }
  else {
    return '';
  }

  // Deal with multiple subvalues like AddressFields:
  // $value[0]['country'] == 'AU'
  // $value[0]['postal_code'] = '3040' etc.
  //
  if ($compressed && is_array($value)) {
    $value = reset($value);
    if (is_array($value)) {
      $value = reset($value);
    }
  }
  return $value;
}