W3cubDocs

/Symfony 2.7

Symfony\Component\Intl\ResourceBundle\RegionBundle

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() from RegionDataProvider
getName($region, $displayLocale = null) from RegionDataProvider
getNames($displayLocale = null) from RegionDataProvider
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

public __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

public getRegions()

public getName($region, $displayLocale = null)

Parameters

$region
$displayLocale

public getNames($displayLocale = null)

Parameters

$displayLocale

public 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.

public 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.

public string[] getLocales()

Returns the list of locales that this bundle supports.

Return Value

string[] A list of locale codes.

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Component/Intl/ResourceBundle/RegionBundle.html