You are here

function views_aggregator_get_aggregation_functions_info in Views Aggregator Plus 8

Same name and namespace in other branches
  1. 7 views_aggregator.module \views_aggregator_get_aggregation_functions_info()

Gets all available aggregation function definitions.

Parameters

string $name: The name of the desired function or NULL to retrieve an array of functions.

Return value

array An array of aggregation function info.

2 calls to views_aggregator_get_aggregation_functions_info()
Table::buildOptionsForm in src/Plugin/views/style/Table.php
Render the given style.
Table::isRenderable in src/Plugin/views/style/Table.php
Returns if the supplied field is renderable through its native function.

File

./views_aggregator.module, line 49
Module implementing post-query aggregation functions for Views tables.

Code

function views_aggregator_get_aggregation_functions_info($name = NULL) {
  $aggregation_functions =& drupal_static(__FUNCTION__);
  if (empty($aggregation_functions)) {

    // Collect aggregations functions defined in other modules via their
    // hook_views_aggregation_functions_info() implementations.
    $aggregation_functions = \Drupal::moduleHandler()
      ->invokeAll('views_aggregation_functions_info');

    // @todo sort by display name, rather than function name
    ksort($aggregation_functions);

    // Let other modules alter the aggregation functions by implementing
    // hook_views_aggregation_functions_info_alter().
    \Drupal::moduleHandler()
      ->alter('views_aggregation_functions_info', $aggregation_functions);
  }
  if (empty($name)) {
    return $aggregation_functions;
  }
  return isset($aggregation_functions[$name]) ? $aggregation_functions[$name] : [];
}