You are here

public function TreeHelper::buildRenderTree in Views tree 8.2

Builds a render tree from an executed view.

File

src/TreeHelper.php, line 34

Class

TreeHelper
The tree helper service.

Namespace

Drupal\views_tree

Code

public function buildRenderTree(ViewExecutable $view, array $rows) {
  $result = $view->result;
  $this->treeValues
    ->setTreeValues($view, $result);
  $result_tree = $this
    ->getTreeFromResult($result);
  return $this
    ->applyFunctionToTree($result_tree, function (ResultRow $row) use ($rows) {
    return $rows[$row->index];
  });
}