public function getTopicsAction(Request $request)
{
$em = $this->container->get('em');
$topics = $em->getRepository('Newscoop\\NewscoopBundle\\Entity\\Topic')->getTopics($request->get('language'));
if (!$topics) {
throw new NotFoundHttpException('Result was not found.');
}
$paginator = $this->get('newscoop.paginator.paginator_service');
$topics = $paginator->paginate($topics, array('distinct' => false));
return $topics;
}