You are here

public function ChainLocaleResolver::resolve in Price 3.0.x

Same name and namespace in other branches
  1. 8 src/Resolver/ChainLocaleResolver.php \Drupal\price\Resolver\ChainLocaleResolver::resolve()
  2. 3.x src/Resolver/ChainLocaleResolver.php \Drupal\price\Resolver\ChainLocaleResolver::resolve()
  3. 2.0.x src/Resolver/ChainLocaleResolver.php \Drupal\price\Resolver\ChainLocaleResolver::resolve()
  4. 2.x src/Resolver/ChainLocaleResolver.php \Drupal\price\Resolver\ChainLocaleResolver::resolve()

Resolves the locale.

Return value

\Drupal\price\Locale|null The locale object, if resolved. Otherwise NULL, indicating that the next resolver in the chain should be called.

Overrides LocaleResolverInterface::resolve

File

src/Resolver/ChainLocaleResolver.php, line 44

Class

ChainLocaleResolver
Default implementation of the chain locale resolver.

Namespace

Drupal\price\Resolver

Code

public function resolve() {
  foreach ($this->resolvers as $resolver) {
    $result = $resolver
      ->resolve();
    if ($result) {
      return $result;
    }
  }
}