You are here

function views_plugin_query_default::get_aggregation_info in Views (for Drupal 7) 6.3

Same name and namespace in other branches
  1. 7.3 plugins/views_plugin_query_default.inc \views_plugin_query_default::get_aggregation_info()

Get aggregation info for group by queries.

If NULL, aggregation is not allowed.

Overrides views_plugin_query::get_aggregation_info

1 call to views_plugin_query_default::get_aggregation_info()
views_plugin_query_default::compile_fields in plugins/views_plugin_query_default.inc

File

plugins/views_plugin_query_default.inc, line 1289
views_plugin_query_default.inc Defines the default query object which builds SQL to execute using the Drupal database API.

Class

views_plugin_query_default
Object used to create a SELECT query.

Code

function get_aggregation_info() {

  // @todo -- need a way to get database specific and customized aggregation
  // functions into here.
  return array(
    'group' => array(
      'title' => t('Group results together'),
      'is aggregate' => FALSE,
    ),
    'count' => array(
      'title' => t('Count'),
      'method' => 'views_query_default_aggregation_method_simple',
      'handler' => array(
        'argument' => 'views_handler_argument_group_by_numeric',
        'field' => 'views_handler_field_group_by_numeric',
        'filter' => 'views_handler_filter_group_by_numeric',
        'sort' => 'views_handler_sort_group_by_numeric',
      ),
    ),
    'sum' => array(
      'title' => t('Sum'),
      'method' => 'views_query_default_aggregation_method_simple',
      'handler' => array(
        'argument' => 'views_handler_argument_group_by_numeric',
        'field' => 'views_handler_field_group_by_numeric',
        'filter' => 'views_handler_filter_group_by_numeric',
        'sort' => 'views_handler_sort_group_by_numeric',
      ),
    ),
    'avg' => array(
      'title' => t('Average'),
      'method' => 'views_query_default_aggregation_method_simple',
      'handler' => array(
        'argument' => 'views_handler_argument_group_by_numeric',
        'field' => 'views_handler_field_group_by_numeric',
        'filter' => 'views_handler_filter_group_by_numeric',
        'sort' => 'views_handler_sort_group_by_numeric',
      ),
    ),
    'min' => array(
      'title' => t('Minimum'),
      'method' => 'views_query_default_aggregation_method_simple',
      'handler' => array(
        'argument' => 'views_handler_argument_group_by_numeric',
        'field' => 'views_handler_field_group_by_numeric',
        'filter' => 'views_handler_filter_group_by_numeric',
        'sort' => 'views_handler_sort_group_by_numeric',
      ),
    ),
    'max' => array(
      'title' => t('Maximum'),
      'method' => 'views_query_default_aggregation_method_simple',
      'handler' => array(
        'argument' => 'views_handler_argument_group_by_numeric',
        'field' => 'views_handler_field_group_by_numeric',
        'filter' => 'views_handler_filter_group_by_numeric',
        'sort' => 'views_handler_sort_group_by_numeric',
      ),
    ),
  );
}