public function getTopicByIdAction($id)
{
$em = $this->container->get('em');
$topic = $em->getRepository('Newscoop\\NewscoopBundle\\Entity\\Topic')->getSingleTopicQuery($id)->getOneOrNullResult();
if (!$topic) {
throw new NotFoundHttpException('Topic was not found.');
}
return $topic;
}