function ArgumentPluginBase::summaryBasics

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php \Drupal\views\Plugin\views\argument\ArgumentPluginBase::summaryBasics()
  2. 8.9.x core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php \Drupal\views\Plugin\views\argument\ArgumentPluginBase::summaryBasics()
  3. 11.x core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php \Drupal\views\Plugin\views\argument\ArgumentPluginBase::summaryBasics()

Adds basic information to the summary query.

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 962

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', [
        '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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.