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

        $this->postManager->switchPinState($post);

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

        $this->postManager->switchPinState($post);

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

@EXT\Route("/pin/{postId}", name="apiv2_blog_post_pin")
@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
Pin post .