You are here

public function ArgumentPluginBase::summaryBasics in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php \Drupal\views\Plugin\views\argument\ArgumentPluginBase::summaryBasics()

Some basic summary behavior that doesn't need to be repeated as much as code that goes into summaryQuery()

4 calls to ArgumentPluginBase::summaryBasics()
ArgumentPluginBase::summaryQuery in core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
Build the info for the summary query.
Formula::summaryQuery in core/modules/views/src/Plugin/views/argument/Formula.php
Build the summary query based on a formula
ManyToOne::summaryQuery in core/modules/views/src/Plugin/views/argument/ManyToOne.php
Build the info for the summary query.
StringArgument::summaryQuery in core/modules/views/src/Plugin/views/argument/StringArgument.php
Build the summary query based on a string

File

core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php, line 901
Contains \Drupal\views\Plugin\views\argument\ArgumentPluginBase.

Class

ArgumentPluginBase
Base class for argument (contextual filter) handler plugins.

Namespace

Drupal\views\Plugin\views\argument

Code

public function summaryBasics($count_field = TRUE) {

  // Add the number of nodes counter
  $distinct = $this->view->display_handler
    ->getOption('distinct') && empty($this->query->no_distinct);
  $count_alias = $this->query
    ->addField($this->view->storage
    ->get('base_table'), $this->view->storage
    ->get('base_field'), 'num_records', array(
    'count' => TRUE,
    'distinct' => $distinct,
  ));
  $this->query
    ->addGroupBy($this->name_alias);
  if ($count_field) {
    $this->query
      ->setCountField($this->tableAlias, $this->realField);
  }
  $this->count_alias = $count_alias;
}