function StringArgument::summaryQuery

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

Build the summary query based on a string.

Overrides ArgumentPluginBase::summaryQuery

File

core/modules/views/src/Plugin/views/argument/StringArgument.php, line 148

Class

StringArgument
Argument handler for string.

Namespace

Drupal\views\Plugin\views\argument

Code

protected function summaryQuery() {
    if (empty($this->definition['many to one'])) {
        $this->ensureMyTable();
    }
    else {
        $this->tableAlias = $this->helper
            ->summaryJoin();
    }
    if (empty($this->options['glossary'])) {
        // Add the field.
        $this->base_alias = $this->query
            ->addField($this->tableAlias, $this->realField);
        $this->query
            ->setCountField($this->tableAlias, $this->realField);
    }
    else {
        // Add the field.
        $formula = $this->getFormula();
        $this->base_alias = $this->query
            ->addField(NULL, $formula, $this->field . '_truncated');
        $this->query
            ->setCountField(NULL, $formula, $this->field, $this->field . '_truncated');
    }
    $this->summaryNameField();
    return $this->summaryBasics(FALSE);
}

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