Bundle/PageBundle/Controller/BasePageController.php
protected function deleteAction(BasePage $page)
    {
        try {
            //Throw Exception if Page is undeletable
            if ($page->isUndeletable()) {
                $message = $this->get('translator')->trans('page.undeletable', [], 'victoire');

                throw new \Exception($message);
            }

            $entityManager = $this->get('doctrine.orm.entity_manager');
            $entityManager->remove($page);
            $entityManager->flush();

            return [
                'success' => true,
                'url'     => $this->generateUrl('victoire_core_homepage_show'),
            ];
        } catch (\Exception $ex) {
            return [
                'success' => false,
                'message' => $ex->getMessage(),
            ];
        }
    }
protected function deleteAction(BasePage $page)
    {
        try {
            //Throw Exception if Page is undeletable
            if ($page->isUndeletable()) {
                $message = $this->get('translator')->trans('page.undeletable', [], 'victoire');

                throw new \Exception($message);
            }

            $entityManager = $this->get('doctrine.orm.entity_manager');
            $entityManager->remove($page);
            $entityManager->flush();

            return [
                'success' => true,
                'url'     => $this->generateUrl('victoire_core_homepage_show'),
            ];
        } catch (\Exception $ex) {
            return [
                'success' => false,
                'message' => $ex->getMessage(),
            ];
        }
    }
protected function deleteAction ( BasePage $ page ) { try { //Throw Exception if Page is undeletable if ( $ page -> isUndeletable ( ) ) { $ message = $ this -> get ( 'translator' ) -> trans ( 'page.undeletable' , [ ] , 'victoire' ) ; throw new \ Exception ( $ message ) ; } $ entityManager = $ this -> get ( 'doctrine.orm.entity_manager' ) ; $ entityManager -> remove ( $ page ) ; $ entityManager -> flush ( ) ; return [ 'success' => true , 'url' => $ this -> generateUrl ( 'victoire_core_homepage_show' ) , ] ; } catch ( \ Exception $ ex ) { return [ 'success' => false , 'message' => $ ex -> getMessage ( ) , ] ; } }
Delete a Page.
Route is defined in inherited controllers.

@param BasePage $page

@return array
Delete a Page . Route is defined in inherited controllers .