You are here

protected function views_data_export_plugin_display_export::initialize_index in Views data export 6.3

Same name and namespace in other branches
  1. 6 plugins/views_data_export_plugin_display_export.inc \views_data_export_plugin_display_export::initialize_index()
  2. 6.2 plugins/views_data_export_plugin_display_export.inc \views_data_export_plugin_display_export::initialize_index()
  3. 7.4 plugins/views_data_export_plugin_display_export.inc \views_data_export_plugin_display_export::initialize_index()
  4. 7 plugins/views_data_export_plugin_display_export.inc \views_data_export_plugin_display_export::initialize_index()
  5. 7.3 plugins/views_data_export_plugin_display_export.inc \views_data_export_plugin_display_export::initialize_index()

Called on export initialization.

Modifies the view query to insert the results into a table, which we call the 'index', this means we essentially have a snapshot of the results, which we can then take time over rendering.

This method is essentially all the best bits of the view::execute() method.

1 call to views_data_export_plugin_display_export::initialize_index()
views_data_export_plugin_display_export::execute_initial in plugins/views_data_export_plugin_display_export.inc
Initializes the whole export process and starts off the batch process.

File

plugins/views_data_export_plugin_display_export.inc, line 495
Contains the bulk export display plugin.

Class

views_data_export_plugin_display_export
The plugin that batches its rendering.

Code

protected function initialize_index() {
  $view =& $this->view;

  // Get views to build the query.
  $view
    ->build();

  // Change the query object to use our custom one.
  $query = new views_data_export_plugin_query_default_batched();

  // Copy the query over:
  foreach ($view->query as $property => $value) {
    $query->{$property} = $value;
  }

  // Replace the query object.
  $view->query = $query;
  $view
    ->execute();
}