public function getCommentsAction()
{
$em = $this->container->get('em');
$showHidden = false;
try {
$user = $this->container->get('user')->getCurrentUser();
if ($user && $user->isAdmin()) {
$showHidden = true;
}
} catch (AuthenticationException $e) {
}
$comments = $em->getRepository('Newscoop\\Entity\\Comment')->getComments(false, $showHidden);
$paginator = $this->get('newscoop.paginator.paginator_service');
$comments = $paginator->paginate($comments, array('distinct' => false));
return $comments;
}