Document/Subscriber/RoutableSubscriber.php
private function removeOldChildRoutes(SessionInterface $session, array $oldRoutes, $locale)
    {
        foreach ($oldRoutes as $oldRoute) {
            $oldRouteEntity = $this->routeRepository->findByPath($oldRoute, $locale);
            if ($oldRouteEntity && !$this->nodeExists($session, $oldRouteEntity->getEntityId())) {
                $this->entityManager->remove($oldRouteEntity);
            }
        }

        $this->entityManager->flush();
    }
private function removeOldChildRoutes(SessionInterface $session, array $oldRoutes, $locale)
    {
        foreach ($oldRoutes as $oldRoute) {
            $oldRouteEntity = $this->routeRepository->findByPath($oldRoute, $locale);
            if ($oldRouteEntity && !$this->nodeExists($session, $oldRouteEntity->getEntityId())) {
                $this->entityManager->remove($oldRouteEntity);
            }
        }

        $this->entityManager->flush();
    }
private function removeOldChildRoutes ( SessionInterface $ session , array $ oldRoutes , $ locale ) { foreach ( $ oldRoutes as $ oldRoute ) { $ oldRouteEntity = $ this -> routeRepository -> findByPath ( $ oldRoute , $ locale ) ; if ( $ oldRouteEntity && ! $ this -> nodeExists ( $ session , $ oldRouteEntity -> getEntityId ( ) ) ) { $ this -> entityManager -> remove ( $ oldRouteEntity ) ; } } $ this -> entityManager -> flush ( ) ; }
Removes old-routes where the node does not exists anymore.

@param SessionInterface $session
@param array $oldRoutes
@param string $locale
Removes old - routes where the node does not exists anymore .