function view::init_query

3.x view.inc view::init_query()
2.x view.inc view::init_query()

Do some common building initialization.

2 calls to view::init_query()
view::build in includes/view.inc
Build the query for the view.
view::build_title in includes/view.inc
Force the view to build a title.

File

includes/view.inc, line 583
view.inc Provides the view object type and associated methods.

Class

view
An object to contain all of the data to generate a view, plus the member functions to build the view query, execute the query and render the output.

Code

function init_query() {
  // Create and initialize the query object.
  $views_data = views_fetch_data($this->base_table);
  $this->base_field = $views_data['table']['base']['field'];
  if (!empty($views_data['table']['base']['database'])) {
    $this->base_database = $views_data['table']['base']['database'];
  }
  views_include('query');
  $this->query = new views_query($this->base_table, $this->base_field);
}