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

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

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