You are here

public function Xml::query in Views XML Backend 8

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 QueryPluginBase::query

1 call to Xml::query()
Xml::build in src/Plugin/views/query/Xml.php
Builds the necessary info to execute the query.

File

src/Plugin/views/query/Xml.php, line 348
Contains \Drupal\views_xml_backend\Plugin\views\query\Xml.

Class

Xml
Views query plugin for an XML query.

Namespace

Drupal\views_xml_backend\Plugin\views\query

Code

public function query($get_count = FALSE) {
  $row_xpath = $this->options['row_xpath'];
  if ($this->filters) {

    // @todo Add an option for the filters to be 'and' or 'or'.
    $row_xpath .= '[' . implode(' and ', $this->filters) . ']';
  }
  if ($this->arguments) {
    $row_xpath .= '[' . implode(' and ', $this->arguments) . ']';
  }
  return $row_xpath;
}