Property | Type | Description | |
---|---|---|---|
$dataCache | array | Cached data. | |
$dataDir | string | Path to the directory containing countries data. | |
$dataSources | array | Available data sources. |
Method | Description | |
---|---|---|
__construct ( string | null $dataDir = null ) | Constructor. | |
getDataDir ( ) : string | ||
getList ( string $locale = 'en', string $format = 'php', string $source = 'cldr' ) : array | Returns a list of countries. | |
getOne ( string $countryCode, string $locale = 'en', string $source = 'cldr' ) : string | Returns one country. | |
has ( string $countryCode, string $locale = 'en', string $source = 'cldr' ) : boolean | Indicates whether or not a given $countryCode matches a country. | |
setList ( string $locale, string $source, array $data ) : |
Method | Description | |
---|---|---|
loadData ( string $locale, string $source, string $format ) : array | A lazy-loader that loads data from a PHP file if it is not stored in memory yet. | |
sortData ( string $locale, array $data ) : array | Sorts the data array for a given locale, using the locale translations. |
public __construct ( string | null $dataDir = null ) | ||
$dataDir | string | null | Path to the directory containing countries data |
protected string $dataDir | ||
return | string |
protected array $dataSources | ||
return | array |