src/Gzero/Cms/Http/Controllers/Api/ContentTreeController.php
public function index(UrlParamsProcessor $processor)
    {
        $this->authorize('readList', Content::class);

        // @TODO Implement contents/{id}/tree
        $processor
            ->addFilter(new BoolParser('only_categories'))
            ->process($this->request);

        Resource::wrap('data');
        return (new ContentCollection($this->repository->getTree($processor->buildQueryBuilder())));
    }
public function index(UrlParamsProcessor $processor)
    {
        $this->authorize('readList', Content::class);

        // @TODO Implement contents/{id}/tree
        $processor
            ->addFilter(new BoolParser('only_categories'))
            ->process($this->request);

        Resource::wrap('data');
        return (new ContentCollection($this->repository->getTree($processor->buildQueryBuilder())));
    }
public function index ( UrlParamsProcessor $ processor ) { $ this -> authorize ( 'readList' , Content :: class ) ; // @TODO Implement contents/{id}/tree $ processor -> addFilter ( new BoolParser ( 'only_categories' ) ) -> process ( $ this -> request ) ; Resource :: wrap ( 'data' ) ; return ( new ContentCollection ( $ this -> repository -> getTree ( $ processor -> buildQueryBuilder ( ) ) ) ) ; }
Fetches all content in a tree structure

@SWG\Get(
path="/contents-tree",
tags={"content"},
summary="Fetches all content in a tree structure",
produces={"application/json"},
security={{"AdminAccess": {}}},
@SWG\Parameter(
name="only_category",
in="query",
description="Should fetch only categories?",
required=false,
type="boolean",
default="false"
),
@SWG\Response(
response=200,
description="Successful operation",
@SWG\Schema(type="array", @SWG\Items(ref="#/definitions/Content"))
),
),

@param UrlParamsProcessor $processor params processor

@return string
Fetches all content in a tree structure