You are here

protected function Xml::calculatePager in Views XML Backend 8

This is currently unused as it's a performance enhancement.

File

src/Plugin/views/query/Xml.php, line 731
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

protected function calculatePager(ViewExecutable $view) {
  if (empty($this->limit) && empty($this->offset)) {
    return;
  }
  $limit = intval(!empty($this->limit) ? $this->limit : 999999);
  $offset = intval(!empty($this->offset) ? $this->offset : 0);
  $limit += $offset;
  $view->build_info['query'] .= "[position() > {$offset} and not(position() > {$limit})]";
}