You are here

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

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

4 calls to ArgumentPluginBase::summary_basics()
ArgumentPluginBase::summary_query in lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php
Build the info for the summary query.
Formula::summary_query in lib/Drupal/views/Plugin/views/argument/Formula.php
Build the summary query based on a formula
ManyToOne::summary_query in lib/Drupal/views/Plugin/views/argument/ManyToOne.php
Build the info for the summary query.
String::summary_query in lib/Drupal/views/Plugin/views/argument/String.php
Build the summary query based on a string

File

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

Class

ArgumentPluginBase
Base class for arguments.

Namespace

Drupal\views\Plugin\views\argument

Code

function summary_basics($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
    ->add_field($this->query->base_table, $this->query->base_field, 'num_records', array(
    'count' => TRUE,
    'distinct' => $distinct,
  ));
  $this->query
    ->add_groupby($this->name_alias);
  if ($count_field) {
    $this->query
      ->set_count_field($this->tableAlias, $this->realField);
  }
  $this->count_alias = $count_alias;
}