protected function performAdditionalDeleteAction($deleteEvent)
    {
        if ($deleteEvent->getProductCount() > 0) {
            $this->getParserContext()->setGeneralError(
                $this->getTranslator()->trans(
                    "This template is in use in some of your products, and cannot be deleted. Delete it from all your products and try again."
                )
            );

            return $this->renderList();
        }

        // Normal delete processing
        return null;
    }
protected function performAdditionalDeleteAction($deleteEvent)
    {
        if ($deleteEvent->getProductCount() > 0) {
            $this->getParserContext()->setGeneralError(
                $this->getTranslator()->trans(
                    "This template is in use in some of your products, and cannot be deleted. Delete it from all your products and try again."
                )
            );

            return $this->renderList();
        }

        // Normal delete processing
        return null;
    }
protected function performAdditionalDeleteAction ( $ deleteEvent ) { if ( $ deleteEvent -> getProductCount ( ) > 0 ) { $ this -> getParserContext ( ) -> setGeneralError ( $ this -> getTranslator ( ) -> trans ( "This template is in use in some of your products, and cannot be deleted. Delete it from all your products and try again." ) ) ; return $ this -> renderList ( ) ; } // Normal delete processing return null ; }
Process delete failure, which may occurs if template is in use.

@param TemplateDeleteEvent $deleteEvent
@return null|\Thelia\Core\HttpFoundation\Response
Process delete failure which may occurs if template is in use .