Newscoop\GimmeBundle\Controller\EditorialCommentsApiController::removeCommentAction PHP Method

removeCommentAction() public method

Edit editorial comments
public removeCommentAction ( Request $request, $number, $language, $commentId )
$request Symfony\Component\HttpFoundation\Request
    public function removeCommentAction(Request $request, $number, $language, $commentId)
    {
        $em = $this->container->get('em');
        $editorialCommentService = $this->container->get('newscoop.editorial_comments');
        $user = $this->container->get('user')->getCurrentUser();
        $comment = $em->getRepository('Newscoop\\ArticlesBundle\\Entity\\EditorialComment')->getOneByArticleAndCommentId($number, $language, $commentId)->getOneOrNullResult();
        if (!$comment) {
            throw new EntityNotFoundException('Result was not found.');
        }
        $editorialCommentService->remove($comment, $user);
        $response = new Response();
        $response->setStatusCode(204);
        return $response;
    }