function 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 1450

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