You are here

protected function Table::collectAggregationFunctions in Views Aggregator Plus 8

Collect the aggregation functions from the Views UI.

Return value

array Functions used for aggregation.

1 call to Table::collectAggregationFunctions()
Table::preRender in src/Plugin/views/style/Table.php
Note that this class being a views_plugin, rather than a views_handler, it does not have a post_execute() function.

File

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

Class

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

Namespace

Drupal\views_aggregator\Plugin\views\style

Code

protected function collectAggregationFunctions() {
  $functions = [];
  foreach ($this->options['info'] as $field_name => $options) {

    // Make a list of the group and column functions to call for this field.
    if (!empty($options['has_aggr'])) {
      foreach ($options['aggr'] as $function) {
        if ($function != 'views_aggregator_row_filter' && $function != 'views_aggregator_group_and_compress') {
          if (empty($functions[$field_name]) || !in_array($function, $functions[$field_name])) {
            $functions[$field_name][] = $function;
          }
        }
      }
    }

    // Column aggregation function, if requested, is last.
    if (!empty($options['has_aggr_column'])) {
      $function = $options['aggr_column'];
      if (empty($functions[$field_name]) || !in_array($function, $functions[$field_name])) {
        $functions[$field_name][] = $function;
      }
    }
  }
  return $functions;
}