You are here

public function ChainCountryResolver::resolve in Price 3.0.x

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

Resolves the country.

Return value

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

Overrides CountryResolverInterface::resolve

File

src/Resolver/ChainCountryResolver.php, line 44

Class

ChainCountryResolver
Default implementation of the chain country resolver.

Namespace

Drupal\price\Resolver

Code

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