public function getCollectionAction(Request $request, $start, $count, Page $parent = null)
    {
        $response = null;
        $contentUid = $request->query->get('content_uid', null);
        $contentType = $request->query->get('content_type', null);

        if (null !== $contentUid && null !== $contentType) {
            $response = $this->doGetCollectionByContent($contentType, $contentUid);
        } elseif ((null === $contentUid && null !== $contentType) || (null !== $contentUid && null === $contentType)) {
            throw new BadRequestHttpException(
                'To get page collection by content, you must provide `content_uid` and `content_type` as query parameters.'
            );
        } elseif ($request->attributes->get('version') == 1) {
            $response = $this->doClassicGetCollectionVersion1($request, $start, $count, $parent);
        } else {
            $response = $this->doClassicGetCollection($request, $start, $count, $parent);
        }

        return $response;
    }
public function getCollectionAction(Request $request, $start, $count, Page $parent = null)
    {
        $response = null;
        $contentUid = $request->query->get('content_uid', null);
        $contentType = $request->query->get('content_type', null);

        if (null !== $contentUid && null !== $contentType) {
            $response = $this->doGetCollectionByContent($contentType, $contentUid);
        } elseif ((null === $contentUid && null !== $contentType) || (null !== $contentUid && null === $contentType)) {
            throw new BadRequestHttpException(
                'To get page collection by content, you must provide `content_uid` and `content_type` as query parameters.'
            );
        } elseif ($request->attributes->get('version') == 1) {
            $response = $this->doClassicGetCollectionVersion1($request, $start, $count, $parent);
        } else {
            $response = $this->doClassicGetCollection($request, $start, $count, $parent);
        }

        return $response;
    }
public function getCollectionAction ( Request $ request , $ start , $ count , Page $ parent = null ) { $ response = null ; $ contentUid = $ request -> query -> get ( 'content_uid' , null ) ; $ contentType = $ request -> query -> get ( 'content_type' , null ) ; if ( null !== $ contentUid && null !== $ contentType ) { $ response = $ this -> doGetCollectionByContent ( $ contentType , $ contentUid ) ; } elseif ( ( null === $ contentUid && null !== $ contentType ) || ( null !== $ contentUid && null === $ contentType ) ) { throw new BadRequestHttpException ( 'To get page collection by content, you must provide `content_uid` and `content_type` as query parameters.' ) ; } elseif ( $ request -> attributes -> get ( 'version' ) == 1 ) { $ response = $ this -> doClassicGetCollectionVersion1 ( $ request , $ start , $ count , $ parent ) ; } else { $ response = $ this -> doClassicGetCollection ( $ request , $ start , $ count , $ parent ) ; } return $ response ; }
Get collection of page entity.

Version 1
- without params return current root
- parent_uid return first level before the parent page

Version 2
- without params return all pages
- `parent_uid` return all pages available before the nested level
- `root` return current root
- `level_offset` permit to choose the depth ex: `parent_uid=oneuid&level_offset=1` equals version 1 parent_uid parameter
- `has_children` return only pages they have children
- new available filter params:
- `title` (is a like method)
- `layout_uid`
- `site_uid`
- `created_before`
- `created_after`
- `modified_before`
- `modified_after`

@return Symfony\Component\HttpFoundation\Response

@Rest\Pagination(default_count=25, max_count=100)

@Rest\QueryParam(name="parent_uid", description="Parent Page UID")

@Rest\QueryParam(name="order_by", description="Page order by", requirements={
@Assert\Type(type="array", message="An array containing at least 1 column name to order by must be provided"),
@Assert\All({
@Assert\Choice(choices = {"asc", "desc"}, message="order direction is not valid")
})
})

@Rest\QueryParam(name="state", description="Page State", requirements={
@Assert\Type(type="array", message="An array containing at least 1 state must be provided"),
@Assert\All({
@Assert\Choice(choices = {"0", "1", "2", "3", "4"}, message="State is not valid")
})
})

@Rest\ParamConverter(
name="parent", id_name="parent_uid", id_source="query", class="BackBee\NestedNode\Page", required=false
)
Get collection of page entity .