You are here

function views_xml_backend_plugin_query_xml::query in Views XML Backend 6

Same name and namespace in other branches
  1. 7 views_xml_backend_plugin_query_xml.inc \views_xml_backend_plugin_query_xml::query()

Generate a query and a countquery from all of the information supplied to the object.

Parameters

$get_count: Provide a countquery if this is true, otherwise provide a normal query.

Overrides views_plugin_query::query

1 call to views_xml_backend_plugin_query_xml::query()
views_xml_backend_plugin_query_xml::build in ./views_xml_backend_plugin_query_xml.inc
Builds the necessary info to execute the query.

File

./views_xml_backend_plugin_query_xml.inc, line 16
Query plugin for views_xml_backend.

Class

views_xml_backend_plugin_query_xml
@file Query plugin for views_xml_backend.

Code

function query($get_count = FALSE) {
  $row_xpath = $this->options['row_xpath'];
  $filter_string = '';
  if (!empty($this->filter)) {
    $filters = array();
    foreach ($this->filter as $filter) {
      $filters[] = $filter
        ->generate();
    }

    /**
     * @todo Add an option for the filters to be 'and' or 'or'.
     */
    $filter_string = '[' . implode(' and ', $filters) . ']';
  }
  return $row_xpath . $filter_string;
}