1 views_plugin_query_default.inc views_plugin_query_default::build(&$view)

Builds the necessary info to execute the query.

Overrides views_plugin_query::build

File

core/modules/views/plugins/views_plugin_query_default.inc, line 1405
Defines the default query object.

Class

views_plugin_query_default
Object used to create a SELECT query.

Code

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);
}