src/BeeTree/Eloquent/AdjacencyList/WholeTreeModelTrait.php
public function tree($rootId, array $columns=[])
    {

        $columns = $this->pickColumns($columns);
        $columnsId = $this->getColumnsCacheId($columns);

        if (isset($this->_hierachyCache[$columnsId][$rootId])) {
            return $this->_hierachyCache[$columnsId][$rootId];
        }

        $result = $this->queryTree($rootId)
                       ->get($this->toSelectColumns($columns));

        $this->fillNodeCache($columnsId, $result);

        return $this->_rootNodeCache[$columnsId][$rootId];

    }
public function tree($rootId, array $columns=[])
    {

        $columns = $this->pickColumns($columns);
        $columnsId = $this->getColumnsCacheId($columns);

        if (isset($this->_hierachyCache[$columnsId][$rootId])) {
            return $this->_hierachyCache[$columnsId][$rootId];
        }

        $result = $this->queryTree($rootId)
                       ->get($this->toSelectColumns($columns));

        $this->fillNodeCache($columnsId, $result);

        return $this->_rootNodeCache[$columnsId][$rootId];

    }
public function tree ( $ rootId , array $ columns = [ ] ) { $ columns = $ this -> pickColumns ( $ columns ) ; $ columnsId = $ this -> getColumnsCacheId ( $ columns ) ; if ( isset ( $ this -> _hierachyCache [ $ columnsId ] [ $ rootId ] ) ) { return $ this -> _hierachyCache [ $ columnsId ] [ $ rootId ] ; } $ result = $ this -> queryTree ( $ rootId ) -> get ( $ this -> toSelectColumns ( $ columns ) ) ; $ this -> fillNodeCache ( $ columnsId , $ result ) ; return $ this -> _rootNodeCache [ $ columnsId ] [ $ rootId ] ; }
Retrieve a tree by its rootId

@param mixed $rootId The id of its root node, which is the same as node->getRootId()
@param array $columns (Optional) Determine which columns have to be fetched from persistence
@return \BeeTree\NodeInterface
Retrieve a tree by its rootId