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];
    }