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;
    }