Service/CategoryService.php
public function getTree($maxLevel = 0, $getHidden = false)
    {
        $hash = $maxLevel . $getHidden;
        if (!isset($this->treeCache[$hash])) {
            $this->setLoadHiddenCategories($getHidden);
            $query = $this->buildQuery();
            $results = $this->repository->execute($query, Repository::RESULTS_OBJECT);
            $tree = $this->buildTree($results, $maxLevel);
            $this->treeCache[$hash] = $tree;
        }

        return $this->treeCache[$hash];
    }
public function getTree($maxLevel = 0, $getHidden = false)
    {
        $hash = $maxLevel . $getHidden;
        if (!isset($this->treeCache[$hash])) {
            $this->setLoadHiddenCategories($getHidden);
            $query = $this->buildQuery();
            $results = $this->repository->execute($query, Repository::RESULTS_OBJECT);
            $tree = $this->buildTree($results, $maxLevel);
            $this->treeCache[$hash] = $tree;
        }

        return $this->treeCache[$hash];
    }
public function getTree ( $ maxLevel = 0 , $ getHidden = false ) { $ hash = $ maxLevel . $ getHidden ; if ( ! isset ( $ this -> treeCache [ $ hash ] ) ) { $ this -> setLoadHiddenCategories ( $ getHidden ) ; $ query = $ this -> buildQuery ( ) ; $ results = $ this -> repository -> execute ( $ query , Repository :: RESULTS_OBJECT ) ; $ tree = $ this -> buildTree ( $ results , $ maxLevel ) ; $ this -> treeCache [ $ hash ] = $ tree ; } return $ this -> treeCache [ $ hash ] ; }
Returns nested category tree.

@param int  $maxLevel
@param bool $getHidden

@return \ArrayIterator
Returns nested category tree .