plugin/blog/Controller/API/PostController.php
public function updatePostAction(Request $request, Blog $blog, Post $post, User $user)
    {
        $this->checkPermission('EDIT', $blog->getResourceNode(), [], true);

        $data = json_decode($request->getContent(), true);
        $post = $this->postManager->updatePost($blog, $post, $this->postSerializer->deserialize($data), $user);

        return new JsonResponse($this->postSerializer->serialize($post));
    }
public function updatePostAction(Request $request, Blog $blog, Post $post, User $user)
    {
        $this->checkPermission('EDIT', $blog->getResourceNode(), [], true);

        $data = json_decode($request->getContent(), true);
        $post = $this->postManager->updatePost($blog, $post, $this->postSerializer->deserialize($data), $user);

        return new JsonResponse($this->postSerializer->serialize($post));
    }
public function updatePostAction ( Request $ request , Blog $ blog , Post $ post , User $ user ) { $ this -> checkPermission ( 'EDIT' , $ blog -> getResourceNode ( ) , [ ] , true ) ; $ data = json_decode ( $ request -> getContent ( ) , true ) ; $ post = $ this -> postManager -> updatePost ( $ blog , $ post , $ this -> postSerializer -> deserialize ( $ data ) , $ user ) ; return new JsonResponse ( $ this -> postSerializer -> serialize ( $ post ) ) ; }
Update blog post.

@EXT\Route("/update/{postId}", name="apiv2_blog_post_update")
@EXT\Method("PUT")
@EXT\ParamConverter("post", class="IcapBlogBundle:Post", options={"mapping": {"postId": "uuid"}})
@EXT\ParamConverter("user", converter="current_user", options={"allowAnonymous"=false})

@param Blog $blog
@param Post $post
@param User $user

@return array
Update blog post .