public function HandlerBase::buildGroupByForm

Provide a form for aggregation settings.

1 call to HandlerBase::buildGroupByForm()
Field::buildGroupByForm in drupal/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php
Extend the groupby form with group columns.
1 method overrides HandlerBase::buildGroupByForm()
Field::buildGroupByForm in drupal/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php
Extend the groupby form with group columns.

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php, line 316
Definition of Drupal\views\Plugin\views\HandlerBase.

Class

HandlerBase

Namespace

Drupal\views\Plugin\views

Code

public function buildGroupByForm(&$form, &$form_state) {
  $display_id = $form_state['display_id'];
  $types = ViewExecutable::viewsHandlerTypes();
  $type = $form_state['type'];
  $id = $form_state['id'];
  $form['#section'] = $display_id . '-' . $type . '-' . $id;
  $this->view
    ->initQuery();
  $info = $this->view->query
    ->getAggregationInfo();
  foreach ($info as $id => $aggregate) {
    $group_types[$id] = $aggregate['title'];
  }
  $form['group_type'] = array(
    '#type' => 'select',
    '#title' => t('Aggregation type'),
    '#default_value' => $this->options['group_type'],
    '#description' => t('Select the aggregation function to use on this field.'),
    '#options' => $group_types,
  );
}