Newscoop\GimmeBundle\Controller\CommentsController::deleteCommentAction PHP Method

deleteCommentAction() public method

Delete comment
public deleteCommentAction ( Request $request, $commentId, $articleNumber = null, $languageCode = null ) : Form
$request Symfony\Component\HttpFoundation\Request
return Form
    public function deleteCommentAction(Request $request, $commentId, $articleNumber = null, $languageCode = null)
    {
        $commentService = $this->container->get('comment');
        $em = $this->container->get('em');
        $comment = $em->getRepository('Newscoop\\Entity\\Comment')->getComment($commentId, false)->getOneOrNullResult();
        if (!$comment) {
            throw new EntityNotFoundException('Result was not found.');
        }
        $commentService->remove($comment);
    }