You are here

protected function Xml::executeSorts in Views XML Backend 8

Executes all added sorts to a view.

Parameters

\Drupal\views\ViewExecutable $view: The view to sort.

1 call to Xml::executeSorts()
Xml::doExecute in src/Plugin/views/query/Xml.php
Performs the actual view execution.

File

src/Plugin/views/query/Xml.php, line 776
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 executeSorts(ViewExecutable $view) {
  foreach (array_reverse($this->orderby) as $sort) {

    // We need to re-index the results before each sort because the index is
    // used to maintain a stable sort.
    $this
      ->reIndexResults($view);
    $sort($view->result);
  }
}