You are here

function views_cumulative_field_views_data in Views Cumulative Field 8

Same name and namespace in other branches
  1. 7 views_cumulative_field.views.inc \views_cumulative_field_views_data()

Implements hook_views_data().

File

./views_cumulative_field.views.inc, line 6

Code

function views_cumulative_field_views_data() {
  $data['views_cumulative_field']['table']['group'] = t('Global');
  $data['views_cumulative_field']['table']['join'] = [
    // Exist in all views.
    '#global' => [],
  ];
  $data['views_cumulative_field']['field_cumulative_field'] = [
    'title' => t('Cumulative Field'),
    'help' => t('Views field that calculates the cumulative value of another field in your view.'),
    'field' => [
      'id' => 'field_cumulative_field',
      // Allow users to specify how precise the results should be. Useful for divisions
      'float' => TRUE,
    ],
  ];
  return $data;
}