You are here

public function views_handler_argument::summary_basics in Views (for Drupal 7) 7.3

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

Some basic summary behavior.

This doesn't need to be repeated as much as code that goes into summary_query().

4 calls to views_handler_argument::summary_basics()
views_handler_argument::summary_query in handlers/views_handler_argument.inc
Build the info for the summary query.
views_handler_argument_formula::summary_query in handlers/views_handler_argument_formula.inc
Build the summary query based on a formula
views_handler_argument_many_to_one::summary_query in handlers/views_handler_argument_many_to_one.inc
Build the info for the summary query.
views_handler_argument_string::summary_query in handlers/views_handler_argument_string.inc
Build the summary query based on a string.

File

handlers/views_handler_argument.inc, line 946
Definition of views_handler_argument.

Class

views_handler_argument
Base class for arguments.

Code

public function summary_basics($count_field = TRUE) {

  // Add the number of nodes counter.
  $distinct = $this->view->display_handler
    ->get_option('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->table_alias, $this->real_field);
  }
  $this->count_alias = $count_alias;
}