public static function getTree(
        Bookboon $bookboon,
        array $blacklistedCategoryIds = [],
        int $depth = 2
    ) : BookboonResponse {
        $bResponse = $bookboon->rawRequest('/categories', ['depth' => $depth]);

        $categories = $bResponse->getReturnArray();

        if (count($blacklistedCategoryIds) !== 0) {
            self::recursiveBlacklist($categories, $blacklistedCategoryIds);
        }

        $bResponse->setEntityStore(
            new EntityStore(Category::getEntitiesFromArray($categories))
        );

        return $bResponse;
    }
public static function getTree(
        Bookboon $bookboon,
        array $blacklistedCategoryIds = [],
        int $depth = 2
    ) : BookboonResponse {
        $bResponse = $bookboon->rawRequest('/categories', ['depth' => $depth]);

        $categories = $bResponse->getReturnArray();

        if (count($blacklistedCategoryIds) !== 0) {
            self::recursiveBlacklist($categories, $blacklistedCategoryIds);
        }

        $bResponse->setEntityStore(
            new EntityStore(Category::getEntitiesFromArray($categories))
        );

        return $bResponse;
    }
public static function getTree ( Bookboon $ bookboon , array $ blacklistedCategoryIds = [ ] , int $ depth = 2 ) : BookboonResponse { $ bResponse = $ bookboon -> rawRequest ( '/categories' , [ 'depth' => $ depth ] ) ; $ categories = $ bResponse -> getReturnArray ( ) ; if ( count ( $ blacklistedCategoryIds ) !== 0 ) { self :: recursiveBlacklist ( $ categories , $ blacklistedCategoryIds ) ; } $ bResponse -> setEntityStore ( new EntityStore ( Category :: getEntitiesFromArray ( $ categories ) ) ) ; return $ bResponse ; }
Returns the entire Category structure.

@param Bookboon $bookboon
@param array $blacklistedCategoryIds
@param int $depth level of recursion (default 2 maximum, 0 no recursion)
@return BookboonResponse
@throws \Bookboon\Api\Exception\UsageException
Returns the entire Category structure .