Newscoop\GimmeBundle\Controller\AttachmentsController::getAttachmentAction PHP Метод

getAttachmentAction() публичный Метод

Get attachment
public getAttachmentAction ( Request $request, $number ) : Form
$request Symfony\Component\HttpFoundation\Request
Результат Form
    public function getAttachmentAction(Request $request, $number)
    {
        $em = $this->container->get('em');
        $attachment = $em->getRepository('Newscoop\\Entity\\Attachment')->getAttachment($number)->getOneOrNullResult();
        if (!$attachment) {
            throw new EntityNotFoundException('Result was not found.');
        }
        return $attachment;
    }