public function DefaultCountryResolver::resolve in Price 2.0.x
Same name and namespace in other branches
- 8 src/Resolver/DefaultCountryResolver.php \Drupal\price\Resolver\DefaultCountryResolver::resolve()
- 3.x src/Resolver/DefaultCountryResolver.php \Drupal\price\Resolver\DefaultCountryResolver::resolve()
- 2.x src/Resolver/DefaultCountryResolver.php \Drupal\price\Resolver\DefaultCountryResolver::resolve()
- 3.0.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\ResolverCode
public function resolve() {
$country_code = $this->configFactory
->get('system.date')
->get('country.default');
return new Country($country_code);
}