You are here

public function views_handler_argument_string::summary_query in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 handlers/views_handler_argument_string.inc \views_handler_argument_string::summary_query()
  2. 6.2 handlers/views_handler_argument_string.inc \views_handler_argument_string::summary_query()

Build the summary query based on a string.

Overrides views_handler_argument::summary_query

File

handlers/views_handler_argument_string.inc, line 148
Definition of views_handler_argument_string.

Class

views_handler_argument_string
Argument handler to implement string arguments that may have length limits.

Code

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

    // Add the field.
    $this->base_alias = $this->query
      ->add_field($this->table_alias, $this->real_field);
    $this->query
      ->set_count_field($this->table_alias, $this->real_field);
  }
  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);
}