/** * {@inheritdoc} */ public function getRouteByName($name) { if (strpos($name, self::ROUTE_PREFIX) !== 0) { throw new RouteNotFoundException(); } $routeId = substr($name, strlen(self::ROUTE_PREFIX)); if (array_key_exists($routeId, $this->symfonyRouteCache)) { return $this->symfonyRouteCache[$routeId]; } /** @var RouteInterface $route */ $route = $this->routeRepository->find($routeId); if (!$route || !$this->routeDefaultsProvider->supports($route->getEntityClass()) || !$this->routeDefaultsProvider->isPublished($route->getEntityClass(), $route->getEntityId(), $route->getLocale())) { throw new RouteNotFoundException(); } return $this->createRoute($route, $this->requestStack->getCurrentRequest()); }