public function getAttachmentsAction(Request $request)
{
$em = $this->container->get('em');
$attachments = $em->getRepository('Newscoop\\Entity\\Attachment')->getAttachments();
$paginator = $this->get('newscoop.paginator.paginator_service');
$attachments = $paginator->paginate($attachments, array('distinct' => false));
return $attachments;
}