class RegionBundle extends RegionDataProvider implements RegionBundleInterface

Default implementation of {@link RegionBundleInterface}.

Methods

__construct(string $path, BundleEntryReaderInterface $reader, LocaleDataProvider $localeProvider)

Creates a new region bundle.

getRegions()

No description

getName($region, $displayLocale = null)

No description

getNames($displayLocale = null)

No description

string|null
getCountryName(string $country, string $displayLocale = null)

Returns the name of a country.

string[]
getCountryNames(string $displayLocale = null)

Returns the names of all known countries.

string[]
getLocales()

Returns the list of locales that this bundle supports.

Details

at line line 37
__construct(string $path, BundleEntryReaderInterface $reader, LocaleDataProvider $localeProvider)

Creates a new region bundle.

Parameters

string $path The path to the directory containing the .res files
BundleEntryReaderInterface $reader The reader for reading the .res files
LocaleDataProvider $localeProvider

in RegionDataProvider at line line 41
getRegions()

in RegionDataProvider at line line 46
getName($region, $displayLocale = null)

Parameters

$region
$displayLocale

in RegionDataProvider at line line 55
getNames($displayLocale = null)

Parameters

$displayLocale

at line line 47
string|null getCountryName(string $country, string $displayLocale = null)

Returns the name of a country.

Parameters

string $country A country code (e.g. "US")
string $displayLocale Optional. The locale to return the name in Defaults to {@link \Locale::getDefault()}.

Return Value

string|null The name of the country or NULL if not found

at line line 59
string[] getCountryNames(string $displayLocale = null)

Returns the names of all known countries.

Parameters

string $displayLocale Optional. The locale to return the names in Defaults to {@link \Locale::getDefault()}.

Return Value

string[] A list of country names indexed by country codes

at line line 71
string[] getLocales()

Returns the list of locales that this bundle supports.

Return Value

string[] A list of locale codes