/** * @Route("/{id}", name="article_review_see") * @Template("frontend/ArticleReview/show.html.twig") * Función para obtener los comentarios de los artículos */ public function commentsAction(ArticleReview $articleReview) { $conference = $this->getConference(); $user = $this->getUser(); $exist = $articleReview->getArticle()->getInscription()->getUser(); if ($user != $exist) { $this->addFlash('alert', $this->get('translator')->trans('You can not see other comments')); return $this->redirectToRoute('article_list'); } $comments = $this->getDoctrine()->getRepository('AppBundle:ReviewComments')->findBy(array('articleReview' => $articleReview)); if ($articleReview->getState() == 'sent') { $this->addFlash('alert', $this->get('translator')->trans('There are not any comments')); return $this->redirectToRoute('article_list'); } return ['conference' => $conference, 'comments' => $comments]; }