public function ViewExecutable::endQueryCapture

Add the list of queries run during render to buildinfo.

See also

View::start_query_capture()

1 call to ViewExecutable::endQueryCapture()
ViewExecutable::render in drupal/core/modules/views/lib/Drupal/views/ViewExecutable.php
Render this view for a certain display.

File

drupal/core/modules/views/lib/Drupal/views/ViewExecutable.php, line 1794
Definition of Drupal\views\ViewExecutable.

Class

ViewExecutable
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.

Namespace

Drupal\views

Code

public function endQueryCapture() {
  global $conf, $queries;
  if (!empty($this->fix_dev_query)) {
    $conf['dev_query'] = FALSE;
  }

  // make a copy of the array so we can manipulate it with array_splice.
  $temp = $queries;

  // Scroll through the queries until we get to our last query key.
  // Unset anything in our temp array.
  if (isset($this->last_query_key)) {
    while (list($id, $query) = each($queries)) {
      if ($id == $this->last_query_key) {
        break;
      }
      unset($temp[$id]);
    }
  }
  $this->additional_queries = $temp;
}