You are here

function ArgumentPluginBase::default_summary in Views (for Drupal 7) 8.3

Default action: summary.

If an argument was expected and was not given, in this case, display a summary query.

File

lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php, line 767
Definition of Drupal\views\Plugin\views\argument\ArgumentPluginBase.

Class

ArgumentPluginBase
Base class for arguments.

Namespace

Drupal\views\Plugin\views\argument

Code

function default_summary() {
  $this->view->build_info['summary'] = TRUE;
  $this->view->build_info['summary_level'] = $this->options['id'];

  // Change the display style to the summary style for this
  // argument.
  $this->view->plugin_name = $this->options['summary']['format'];
  $this->view->style_options = $this->options['summary_options'];

  // Clear out the normal primary field and whatever else may have
  // been added and let the summary do the work.
  $this->query
    ->clear_fields();
  $this
    ->summary_query();
  $by = $this->options['summary']['number_of_records'] ? 'num_records' : NULL;
  $this
    ->summary_sort($this->options['summary']['sort_order'], $by);

  // Summaries have their own sorting and fields, so tell the View not
  // to build these.
  $this->view->build_sort = FALSE;
  return TRUE;
}