You are here

public function Table::isRenderable in Views Aggregator Plus 8

Returns if the supplied field is renderable through its native function.

Parameters

string $field_name: Field name to check.

bool $is_column: TRUE, if we handle column aggregation.

Return value

bool TRUE, if the field is renderable through its native function.

2 calls to Table::isRenderable()
Table::setCell in src/Plugin/views/style/Table.php
Render and set a raw value on the table cell in specified column and row.
Table::setTotalsRow in src/Plugin/views/style/Table.php
Write the aggregated results back into the View results totals (footer).

File

src/Plugin/views/style/Table.php, line 1288

Class

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

Namespace

Drupal\views_aggregator\Plugin\views\style

Code

public function isRenderable($field_name, $is_column = FALSE) {
  if (empty($this->options['info'][$field_name][$is_column ? 'has_aggr_column' : 'has_aggr'])) {
    return TRUE;
  }
  $aggr_functions = $this->options['info'][$field_name][$is_column ? 'aggr_column' : 'aggr'];
  $aggr_function = is_array($aggr_functions) ? end($aggr_functions) : $aggr_functions;
  $aggr_function_info = views_aggregator_get_aggregation_functions_info($aggr_function);

  // Aggregation functions are considered renderable unless set to FALSE.
  return !isset($aggr_function_info['is_renderable']) || !empty($aggr_function_info['is_renderable']);
}