public function buildTree($results)
    {
        if (!count($results)) {
            return;
        }

        $root = $results[0];
        $root->buildTree($results);

        return $root;
    }
public function buildTree($results)
    {
        if (!count($results)) {
            return;
        }

        $root = $results[0];
        $root->buildTree($results);

        return $root;
    }
public function buildTree ( $ results ) { if ( ! count ( $ results ) ) { return ; } $ root = $ results [ 0 ] ; $ root -> buildTree ( $ results ) ; return $ root ; }
Extracts the root node and constructs a tree using flat resultset

@param Iterable|array $results a flat resultset

@return NodeInterface
Extracts the root node and constructs a tree using flat resultset