CountryProvider

class \TYPO3\CMS\Core\Country\CountryProvider

A class providing information about all countries.

Country data is generated from "Build/Scripts/updateIsoDatabase.php" (which in turn stems from https://github.com/sokil/php-isocodes-db-i18n)

Attributes

#[AsAlias]
'country.provider'
$public: true
#[Autoconfigure]
$public: true

Table of Contents

Methods

__construct()  : mixed
getAll()  : Country[]
getByAlpha2IsoCode()  : Country|null
getByAlpha3IsoCode()  : Country|null
getByEnglishName()  : Country|null
getByIsoCode()  : Country|null
Searches for a matching country with fallback; uses Alpha2 ISO-Code by default, and if that does not match, compare the input $isoCode as an Alpha3 ISO-Code.
getFiltered()  : array<string, Country>

Methods

getByAlpha2IsoCode()

public getByAlpha2IsoCode(string $isoCode) : Country|null

Parameters

$isoCode : string

Return values

Country|null

getByAlpha3IsoCode()

public getByAlpha3IsoCode(string $isoCode) : Country|null

Parameters

$isoCode : string

Return values

Country|null

getByEnglishName()

public getByEnglishName(string $name) : Country|null

Parameters

$name : string

Return values

Country|null

getByIsoCode()

Searches for a matching country with fallback; uses Alpha2 ISO-Code by default, and if that does not match, compare the input $isoCode as an Alpha3 ISO-Code.

public getByIsoCode(string $isoCode) : Country|null

Parameters

$isoCode : string

Return values

Country|null
On this page