Controller/EpisodeController.php
public function deleteAction(Request $request, $id)
    {
        $form = $this->createDeleteForm($id);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $entity = $em->getRepository('OktolabMediaBundle:Episode')->find($id);

            if (!$entity) {
                throw $this->createNotFoundException('Unable to find Episode entity.');
            }

            $this->get('oktolab_media_helper')->deleteEpisode($episode);
        }

        return $this->redirect($this->generateUrl('oktolab_episode'));
    }
public function deleteAction(Request $request, $id)
    {
        $form = $this->createDeleteForm($id);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $entity = $em->getRepository('OktolabMediaBundle:Episode')->find($id);

            if (!$entity) {
                throw $this->createNotFoundException('Unable to find Episode entity.');
            }

            $this->get('oktolab_media_helper')->deleteEpisode($episode);
        }

        return $this->redirect($this->generateUrl('oktolab_episode'));
    }
public function deleteAction ( Request $ request , $ id ) { $ form = $ this -> createDeleteForm ( $ id ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isValid ( ) ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ entity = $ em -> getRepository ( 'OktolabMediaBundle:Episode' ) -> find ( $ id ) ; if ( ! $ entity ) { throw $ this -> createNotFoundException ( 'Unable to find Episode entity.' ) ; } $ this -> get ( 'oktolab_media_helper' ) -> deleteEpisode ( $ episode ) ; } return $ this -> redirect ( $ this -> generateUrl ( 'oktolab_episode' ) ) ; }
Deletes a Episode entity.

@Route("/{id}", name="oktolab_episode_delete")
@Method("DELETE")
Deletes a Episode entity .