src/Sulu/Bundle/RouteBundle/Controller/RouteController.php
public function deleteAction($id)
    {
        /** @var RouteRepositoryInterface $routeRespository */
        $routeRespository = $this->get('sulu.repository.route');

        $route = $routeRespository->find($id);
        if (!$route) {
            throw new EntityNotFoundException(RouteInterface::class, $id);
        }

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

        return $this->handleView($this->view());
    }
public function deleteAction($id)
    {
        /** @var RouteRepositoryInterface $routeRespository */
        $routeRespository = $this->get('sulu.repository.route');

        $route = $routeRespository->find($id);
        if (!$route) {
            throw new EntityNotFoundException(RouteInterface::class, $id);
        }

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

        return $this->handleView($this->view());
    }
public function deleteAction ( $ id ) { /** @var RouteRepositoryInterface $routeRespository */ $ routeRespository = $ this -> get ( 'sulu.repository.route' ) ; $ route = $ routeRespository -> find ( $ id ) ; if ( ! $ route ) { throw new EntityNotFoundException ( RouteInterface :: class , $ id ) ; } $ entityManager = $ this -> get ( 'doctrine.orm.entity_manager' ) ; $ entityManager -> remove ( $ route ) ; $ entityManager -> flush ( ) ; return $ this -> handleView ( $ this -> view ( ) ) ; }
Delete given history-route.

@param int $id

@return Response

@throws EntityNotFoundException
Delete given history - route .