public function deleteAction(Request $request, SakonninFile $file, $access)
    {
        $form = $this->createDeleteForm($file);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrineManager();
            $em->remove($file);
            $em->flush();
            if ($back = $request->request->get('back'))
                return $this->redirect($back);
        }

        return $this->redirectToRoute('file_index');
    }
public function deleteAction(Request $request, SakonninFile $file, $access)
    {
        $form = $this->createDeleteForm($file);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrineManager();
            $em->remove($file);
            $em->flush();
            if ($back = $request->request->get('back'))
                return $this->redirect($back);
        }

        return $this->redirectToRoute('file_index');
    }
public function deleteAction ( Request $ request , SakonninFile $ file , $ access ) { $ form = $ this -> createDeleteForm ( $ file ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isSubmitted ( ) && $ form -> isValid ( ) ) { $ em = $ this -> getDoctrineManager ( ) ; $ em -> remove ( $ file ) ; $ em -> flush ( ) ; if ( $ back = $ request -> request -> get ( 'back' ) ) return $ this -> redirect ( $ back ) ; } return $ this -> redirectToRoute ( 'file_index' ) ; }
Deletes a file entity.

@Route("/{id}", name="file_delete", methods={"DELETE"})
Deletes a file entity .