src/Sulu/Bundle/RouteBundle/Manager/RouteManager.php
private function resolve(RouteInterface $route, RoutableInterface $entity)
    {
        $persistedRoute = $this->routeRepository->findByPath($route->getPath(), $route->getLocale());

        if (!$persistedRoute) {
            return $route;
        }

        if ($persistedRoute->getEntityClass() === $route->getEntityClass()
            && $persistedRoute->getEntityId() === $route->getEntityId()
        ) {
            return $persistedRoute;
        }

        throw new RouteIsNotUniqueException($route, $entity);
    }
private function resolve(RouteInterface $route, RoutableInterface $entity)
    {
        $persistedRoute = $this->routeRepository->findByPath($route->getPath(), $route->getLocale());

        if (!$persistedRoute) {
            return $route;
        }

        if ($persistedRoute->getEntityClass() === $route->getEntityClass()
            && $persistedRoute->getEntityId() === $route->getEntityId()
        ) {
            return $persistedRoute;
        }

        throw new RouteIsNotUniqueException($route, $entity);
    }
private function resolve ( RouteInterface $ route , RoutableInterface $ entity ) { $ persistedRoute = $ this -> routeRepository -> findByPath ( $ route -> getPath ( ) , $ route -> getLocale ( ) ) ; if ( ! $ persistedRoute ) { return $ route ; } if ( $ persistedRoute -> getEntityClass ( ) === $ route -> getEntityClass ( ) && $ persistedRoute -> getEntityId ( ) === $ route -> getEntityId ( ) ) { return $ persistedRoute ; } throw new RouteIsNotUniqueException ( $ route , $ entity ) ; }
Looks for the same route in the database.
If no route was found the method returns the newly created route.
If the route is a history route for given entity the history route will be returned.
Else a RouteIsNotUniqueException will be thrown.

@param RouteInterface $route
@param RoutableInterface $entity

@return RouteInterface

@throws RouteIsNotUniqueException
Looks for the same route in the database . If no route was found the method returns the newly created route . If the route is a history route for given entity the history route will be returned . Else a RouteIsNotUniqueException will be thrown .