메소드 | 설명 | |
---|---|---|
getChildTerritoryCodes ( string $parentTerritoryCode, boolean $expandSubGroups = false ) : array | Retrieve the child territories of a parent territory. | |
getContinents ( string $locale = '' ) : array | Return the list of continents in the form of an array with key=ID, value=name. | |
getContinentsAndCountries ( string $locale = '' ) : array | Return a list of continents and relative countries. The resulting array is in the following form (JSON representation): ```json { "002": { "name": "Africa", "children": { "DZ": {"name": "Algeria"}, "AO": {"name": "Angola"}, . | |
getCountries ( string $locale = '' ) : array | Return the list of countries in the form of an array with key=ID, value=name. | |
getGrossDomesticProduct ( string $territoryCode ) : number | null | Return the GDP (Gross Domestic Product) for a specific territory, in US$. | |
getLanguages ( string $territoryCode, string $filterStatuses = '', string $onlyCodes = false ) : array | null | Return the list of languages spoken in a territory. | |
getList ( string $levels = 'W', string $locale = '' ) : array | Return a list of some specified territory, structured or not. | |
getLiteracyLevel ( string $territoryCode ) : number | null | Return the literacy level for a specific territory, in %. | |
getName ( string $territoryCode, string $locale = '' ) : string | Retrieve the name of a territory (country, continent, . | |
getParentTerritoryCode ( string $childTerritoryCode ) : string | Return the code of the territory that contains a territory. | |
getPopulation ( string $territoryCode ) : number | null | Return the population of a specific territory. | |
getTerritoriesForLanguage ( string $languageID, float $threshold ) : array | Return a list of territory IDs where a specific language is spoken, sorted by the total number of people speaking that language. | |
getTerritoriesWithInfo ( ) : array | Return a list of territory identifiers for which we have some info (languages, population, literacy level, Gross Domestic Product). |
메소드 | 설명 | |
---|---|---|
fillStructure ( $data, $id, $level ) | ||
filterStructure ( $parent, $levels ) | ||
finalizeWithNames ( $data, $list, $flatList ) | ||
getStructure ( ) | ||
getTerritoryInfo ( $territoryCode ) | ||
sort ( $list ) |
public static getChildTerritoryCodes ( string $parentTerritoryCode, boolean $expandSubGroups = false ) : array | ||
$parentTerritoryCode | string | |
$expandSubGroups | boolean | Set to true to expand the sub-groups, false to retrieve them. |
리턴 | array | Return the list of territory codes that are children of $parentTerritoryCode (if $parentTerritoryCode is invalid you'll get an empty list) |
public static getContinents ( string $locale = '' ) : array | ||
$locale | string | The locale to use. If empty we'll use the default locale set in \Punic\Data |
리턴 | array |
public static getContinentsAndCountries ( string $locale = '' ) : array | ||
$locale | string | The locale to use. If empty we'll use the default locale set in \Punic\Data |
리턴 | array |
public static getCountries ( string $locale = '' ) : array | ||
$locale | string | The locale to use. If empty we'll use the default locale set in \Punic\Data |
리턴 | array |
public static getLanguages ( string $territoryCode, string $filterStatuses = '', string $onlyCodes = false ) : array | null | ||
$territoryCode | string | The territory code |
$filterStatuses | string | Filter language status.
|
$onlyCodes | string | Set to true to retrieve only the language codes. If set to false (default) you'll receive a list of arrays with these keys:
|
리턴 | array | null | Return the languages spoken in the specified territory, as described by the $onlyCodes parameter (or null if $territoryCode is not valid or no data is available) |
public static getList ( string $levels = 'W', string $locale = '' ) : array | ||
$levels | string | A string with one or more of the characters: 'W' (for world), 'C' (for continents), 'S' (for sub-continents), 'c' (for countries) |
$locale | string | The locale to use. If empty we'll use the default locale set in \Punic\Data |
리턴 | array |
public static getParentTerritoryCode ( string $childTerritoryCode ) : string | ||
$childTerritoryCode | string | |
리턴 | string | Return the parent territory code, or an empty string if $childTerritoryCode is the World (001) or if it's invalid. |
public static getTerritoriesWithInfo ( ) : array | ||
리턴 | array | The list of territory IDs for which we have some info |