/** * @Route("/comment_enable/{id}", name="admin_enable_comment") * @ParamConverter("comment", options={"mapping": {"id": "id"}}) * @Security("has_role('ROLE_ADMIN')") */ public function enableCommentAction(Request $request, Comment $comment) { $comment->setEnabled(true); $em = $this->getDoctrine()->getManager(); $em->flush(); return $this->redirectToRoute('admin_comments'); }