src/Sulu/Component/Content/Document/Subscriber/RouteSubscriber.php
private function recursivelyRemoveRoutes(RouteBehavior $document)
    {
        $referrers = $this->documentInspector->getReferrers($document);

        foreach ($referrers as $referrer) {
            if (!$referrer instanceof RouteBehavior) {
                continue;
            }

            $this->recursivelyRemoveRoutes($referrer);
            $this->documentManager->remove($referrer);
        }
    }
private function recursivelyRemoveRoutes(RouteBehavior $document)
    {
        $referrers = $this->documentInspector->getReferrers($document);

        foreach ($referrers as $referrer) {
            if (!$referrer instanceof RouteBehavior) {
                continue;
            }

            $this->recursivelyRemoveRoutes($referrer);
            $this->documentManager->remove($referrer);
        }
    }
private function recursivelyRemoveRoutes ( RouteBehavior $ document ) { $ referrers = $ this -> documentInspector -> getReferrers ( $ document ) ; foreach ( $ referrers as $ referrer ) { if ( ! $ referrer instanceof RouteBehavior ) { continue ; } $ this -> recursivelyRemoveRoutes ( $ referrer ) ; $ this -> documentManager -> remove ( $ referrer ) ; } }
Remove given Route and his history.

@param $document
Remove given Route and his history .