You are here

public function DefaultCountryResolver::resolve in Price 3.0.x

Same name and namespace in other branches
  1. 8 src/Resolver/DefaultCountryResolver.php \Drupal\price\Resolver\DefaultCountryResolver::resolve()
  2. 3.x src/Resolver/DefaultCountryResolver.php \Drupal\price\Resolver\DefaultCountryResolver::resolve()
  3. 2.0.x src/Resolver/DefaultCountryResolver.php \Drupal\price\Resolver\DefaultCountryResolver::resolve()
  4. 2.x src/Resolver/DefaultCountryResolver.php \Drupal\price\Resolver\DefaultCountryResolver::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/DefaultCountryResolver.php, line 33

Class

DefaultCountryResolver
Returns the site's default country.

Namespace

Drupal\price\Resolver

Code

public function resolve() {
  $country_code = $this->configFactory
    ->get('system.date')
    ->get('country.default');
  return new Country($country_code);
}