function view::init_query

cis7 view.inc view::init_query()
cle7 view.inc view::init_query()
elmsmedia7 view.inc view::init_query()
icor7 view.inc view::init_query()
meedjum_blog7 view.inc view::init_query()
mooc7 view.inc view::init_query()

Do some common building initialization.

3 calls to view::init_query()
view::build in sites/all/modules/ulmus/views/includes/view.inc
Build the query for the view.
view::build_title in sites/all/modules/ulmus/views/includes/view.inc
Force the view to build a title.
view::export in sites/all/modules/ulmus/views/includes/view.inc
Export a view as PHP code.

File

sites/all/modules/ulmus/views/includes/view.inc, line 886
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() {
  if (!empty($this->query)) {
    $class = get_class($this->query);
    if ($class && $class != 'stdClass') {
      // return if query is already initialized.
      return TRUE;
    }
  }

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

  // Load the options.
  $query_options = $this->display_handler->get_option('query');

  // Create and initialize the query object.
  $plugin = !empty($views_data['table']['base']['query class']) ? $views_data['table']['base']['query class'] : 'views_query';
  $this->query = views_get_plugin('query', $plugin);

  if (empty($this->query)) {
    return FALSE;
  }

  $this->query->init($this->base_table, $this->base_field, $query_options['options']);
  return TRUE;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.