protected function ContentAwareGenerator::getRouteByLocale

Parameters

RouteCollection $routes:

string $locale:

Return value

bool|SymfonyRoute false if no route requirement matches the provided locale

2 calls to ContentAwareGenerator::getRouteByLocale()
ContentAwareGenerator::getBestLocaleRoute in drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/ContentAwareGenerator.php
Determine if there is a route with matching locale associated with the given route via associated content.
ContentAwareGenerator::getRouteByContent in drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/ContentAwareGenerator.php
Get the route based on the $name that is a RouteAwareInterface or a RouteAwareInterface content found in the content repository with the content_id specified in parameters.

File

drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/ContentAwareGenerator.php, line 184

Class

ContentAwareGenerator
A generator that tries to generate routes from object, route names or content objects or names.

Namespace

Symfony\Cmf\Component\Routing

Code

protected function getRouteByLocale($routes, $locale) {
  foreach ($routes as $route) {
    if (!$route instanceof SymfonyRoute) {
      continue;
    }
    if ($this
      ->checkLocaleRequirement($route, $locale)) {
      return $route;
    }
  }
  return false;
}