You are here

public function ChainCountryResolver::resolve in Commerce Core 8.2

Resolves the country.

Return value

\Drupal\commerce\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\commerce\Resolver

Code

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