public function deletePostAction($id)
    {
        $post = $this->getPost($id);

        try {
            $this->postManager->delete($post);
        } catch (\Exception $e) {
            return View::create(['error' => $e->getMessage()], 400);
        }

        return ['deleted' => true];
    }
public function deletePostAction($id)
    {
        $post = $this->getPost($id);

        try {
            $this->postManager->delete($post);
        } catch (\Exception $e) {
            return View::create(['error' => $e->getMessage()], 400);
        }

        return ['deleted' => true];
    }
public function deletePostAction ( $ id ) { $ post = $ this -> getPost ( $ id ) ; try { $ this -> postManager -> delete ( $ post ) ; } catch ( \ Exception $ e ) { return View :: create ( [ 'error' => $ e -> getMessage ( ) ] , 400 ) ; } return [ 'deleted' => true ] ; }
Deletes a post.

@ApiDoc(
requirements={
{"name"="id", "dataType"="integer", "requirement"="\d+", "description"="post identifier"}
},
statusCodes={
200="Returned when post is successfully deleted",
400="Returned when an error has occurred while post deletion",
404="Returned when unable to find post"
}
)

@REST\Route(requirements={"_format"="json|xml"})

@param int $id A Post identifier

@throws NotFoundHttpException

@return View
Deletes a post .