original_string: 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'));
      }
code: 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'));
      }
code_tokens: 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' ) ) ; }
docstring: Deletes a Episode entity.
  
  @Route("/{id}", name="oktolab_episode_delete")
  @Method("DELETE")
docstring_tokens: Deletes a Episode entity .