You are here

public function views_plugin_query_default::build in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 plugins/views_plugin_query_default.inc \views_plugin_query_default::build()

Builds the necessary info to execute the query.

Overrides views_plugin_query::build

File

plugins/views_plugin_query_default.inc, line 1448
Definition of views_plugin_query_default.

Class

views_plugin_query_default
Object used to create a SELECT query.

Code

public function build(&$view) {

  // Make the query distinct if the option was set.
  if (!empty($this->options['distinct'])) {
    $this
      ->set_distinct(TRUE, !empty($this->options['pure_distinct']));
  }

  // Store the view in the object to be able to use it later.
  $this->view = $view;
  $view
    ->init_pager();

  // Let the pager modify the query to add limits.
  $this->pager
    ->query();
  $view->build_info['query'] = $this
    ->query();
  $view->build_info['count_query'] = $this
    ->query(TRUE);
}