original_string: public function deleteAction(Request $request, Brand $brand)
      {
          $form = $this->createDeleteForm($brand);
          $form->handleRequest($request);
  
          if ($form->isSubmitted() && $form->isValid()) {
              
              $em = $this->getDoctrine()->getManager();
              $em->remove($brand);
              $em->flush();
              
              $this->get('session')->getFlashBag()->add('info', 'brand.deleted');
          }
  
          return $this->redirectToRoute('ecommerce_brand_index');
      }
code: public function deleteAction(Request $request, Brand $brand)
      {
          $form = $this->createDeleteForm($brand);
          $form->handleRequest($request);
  
          if ($form->isSubmitted() && $form->isValid()) {
              
              $em = $this->getDoctrine()->getManager();
              $em->remove($brand);
              $em->flush();
              
              $this->get('session')->getFlashBag()->add('info', 'brand.deleted');
          }
  
          return $this->redirectToRoute('ecommerce_brand_index');
      }
code_tokens: public function deleteAction ( Request $ request , Brand $ brand ) { $ form = $ this -> createDeleteForm ( $ brand ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isSubmitted ( ) && $ form -> isValid ( ) ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ em -> remove ( $ brand ) ; $ em -> flush ( ) ; $ this -> get ( 'session' ) -> getFlashBag ( ) -> add ( 'info' , 'brand.deleted' ) ; } return $ this -> redirectToRoute ( 'ecommerce_brand_index' ) ; }
docstring: Deletes a Brand entity.
  
  @Route("/{id}")
  @Method("DELETE")
docstring_tokens: Deletes a Brand entity .