Sulu\Bundle\RouteBundle\Manager\AutoIncrementConflictResolver::resolve PHP Method

resolve() public method

public resolve ( Sulu\Bundle\RouteBundle\Model\RouteInterface $route )
$route Sulu\Bundle\RouteBundle\Model\RouteInterface
    public function resolve(RouteInterface $route)
    {
        $i = 1;
        $path = $route->getPath();
        $conflict = $this->routeRepository->findByPath($route->getPath(), $route->getLocale());
        while ($conflict) {
            if ($conflict && $conflict->getEntityClass() === $route->getEntityClass() && $conflict->getEntityId() == $route->getEntityId()) {
                // if conflict is found but has the same entity relation return this instead of the newly created route.
                return $conflict;
            }
            $route->setPath($path . '-' . $i++);
            $conflict = $this->routeRepository->findByPath($route->getPath(), $route->getLocale());
        }
        return $route;
    }
AutoIncrementConflictResolver