plugin/blog/Controller/API/PostController.php
public function listAction(Request $request, Blog $blog)
    {
        $this->checkPermission('OPEN', $blog->getResourceNode(), [], true);

        $parameters = $request->query->all();

        //if no edit rights, list only published posts
        $posts = $this->postManager->getPosts(
            $blog->getId(),
            $parameters,
            $this->checkPermission('ADMINISTRATE', $blog->getResourceNode())
            || $this->checkPermission('EDIT', $blog->getResourceNode())
            || $this->checkPermission('MODERATE', $blog->getResourceNode())
                ? PostManager::GET_ALL_POSTS
                : PostManager::GET_PUBLISHED_POSTS,
            !$blog->getOptions()->getDisplayFullPosts());

        return new JsonResponse($posts);
    }
public function listAction(Request $request, Blog $blog)
    {
        $this->checkPermission('OPEN', $blog->getResourceNode(), [], true);

        $parameters = $request->query->all();

        //if no edit rights, list only published posts
        $posts = $this->postManager->getPosts(
            $blog->getId(),
            $parameters,
            $this->checkPermission('ADMINISTRATE', $blog->getResourceNode())
            || $this->checkPermission('EDIT', $blog->getResourceNode())
            || $this->checkPermission('MODERATE', $blog->getResourceNode())
                ? PostManager::GET_ALL_POSTS
                : PostManager::GET_PUBLISHED_POSTS,
            !$blog->getOptions()->getDisplayFullPosts());

        return new JsonResponse($posts);
    }
public function listAction ( Request $ request , Blog $ blog ) { $ this -> checkPermission ( 'OPEN' , $ blog -> getResourceNode ( ) , [ ] , true ) ; $ parameters = $ request -> query -> all ( ) ; //if no edit rights, list only published posts $ posts = $ this -> postManager -> getPosts ( $ blog -> getId ( ) , $ parameters , $ this -> checkPermission ( 'ADMINISTRATE' , $ blog -> getResourceNode ( ) ) || $ this -> checkPermission ( 'EDIT' , $ blog -> getResourceNode ( ) ) || $ this -> checkPermission ( 'MODERATE' , $ blog -> getResourceNode ( ) ) ? PostManager :: GET_ALL_POSTS : PostManager :: GET_PUBLISHED_POSTS , ! $ blog -> getOptions ( ) -> getDisplayFullPosts ( ) ) ; return new JsonResponse ( $ posts ) ; }
Get blog posts.

@EXT\Route("", name="apiv2_blog_post_list")
@EXT\Method("GET")

@param Blog $blog

@return array
Get blog posts .