function String::summary_query

Build the summary query based on a string

Overrides ArgumentPluginBase::summary_query

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/argument/String.php, line 146
Definition of Drupal\views\Plugin\views\argument\String.

Class

String
Basic argument handler to implement string arguments that may have length limits.

Namespace

Drupal\views\Plugin\views\argument

Code

function summary_query() {
  if (empty($this->definition['many to one'])) {
    $this
      ->ensureMyTable();
  }
  else {
    $this->tableAlias = $this->helper
      ->summary_join();
  }
  if (empty($this->options['glossary'])) {

    // Add the field.
    $this->base_alias = $this->query
      ->add_field($this->tableAlias, $this->realField);
    $this->query
      ->set_count_field($this->tableAlias, $this->realField);
  }
  else {

    // Add the field.
    $formula = $this
      ->get_formula();
    $this->base_alias = $this->query
      ->add_field(NULL, $formula, $this->field . '_truncated');
    $this->query
      ->set_count_field(NULL, $formula, $this->field, $this->field . '_truncated');
  }
  $this
    ->summary_name_field();
  return $this
    ->summary_basics(FALSE);
}