You are here

private function ComplexGrouping::getGroupingDefaultValues in Views Complex Grouping 8

Get default value for complex grouping options.

1 call to ComplexGrouping::getGroupingDefaultValues()
ComplexGrouping::buildOptionsForm in src/Plugin/views/style/ComplexGrouping.php
Provide a form to edit options for this plugin.

File

src/Plugin/views/style/ComplexGrouping.php, line 107

Class

ComplexGrouping
Class ComplexGrouping.

Namespace

Drupal\views_complex_grouping\Plugin\views\style

Code

private function getGroupingDefaultValues($index, $key) {
  $default_option = NULL;
  $options = $this->options['grouping'];
  switch ($key) {
    case 'grouping_limit':
      $default_value = 0;
      break;
    case 'grouping_offset':
      $default_value = 0;
      break;
    case 'grouping_fields':
    default:
      $default_value = NULL;
      break;
  }
  $default_option = isset($options[$index]) ? $options[$index]['complex_grouping'][$key] ?: $default_value : $default_value;
  return $default_option;
}