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');
    }
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');
    }
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' ) ; }
Deletes a Brand entity.

@Route("/{id}")
@Method("DELETE")
Deletes a Brand entity .