Definition at line 15 of file Lists.php.
◆ __construct()
- Parameters
-
ConfigInterface | $localeConfig | |
Definition at line 34 of file Lists.php.
37 $this->allowedCurrencies =
$localeConfig->getAllowedCurrencies();
◆ getCurrencyList()
Retrieve list of currencies
- Returns
- array
Definition at line 70 of file Lists.php.
75 $isAllowedCurrency = array_search(
$code, $this->allowedCurrencies) !==
false;
76 if (!$isAllowedCurrency) {
◆ getLocaleList()
Retrieve list of locales
- Returns
- array
Definition at line 90 of file Lists.php.
94 $locales = \ResourceBundle::getLocales(
'') ?: [];
97 if (!in_array($locale, $this->allowedLocales)) {
100 $language = \Locale::getPrimaryLanguage($locale);
101 $country = \Locale::getRegion($locale);
102 if (!$languages[$language] || !$countries[$country]) {
105 $list[$locale] = $languages[$language] .
' (' . $countries[$country] .
')';
◆ getTimezoneList()
getTimezoneList |
( |
|
$doSort = true | ) |
|
Retrieve list of timezones
- Parameters
-
- Returns
- array
Definition at line 46 of file Lists.php.
48 $zones = \DateTimeZone::listIdentifiers(\DateTimeZone::ALL);
50 foreach ($zones as
$code) {
51 $list[
$code] = \IntlTimeZone::createTimeZone(
$code)->getDisplayName(
53 \IntlTimeZone::DISPLAY_LONG,
55 ) .
' (' .
$code .
')';
◆ $allowedLocales
The documentation for this class was generated from the following file: