CoolCMS API

CountryOptionsHelper
in package

FinalYes

Order of the country select: Czechia and Slovakia first (the portal's home markets), then alphabetically by the name in the UI language (diacritics-insensitive — no `ext-intl` Collator at runtime, it is not a composer requirement).

Table of Contents

Constants

PREFERRED_CODES  : array<string|int, mixed> = ['CZ', 'SK']

Methods

fromEntities()  : array<string, string>
Options from country entities (`getCountryCode()`, `getActive()`, `getTranslation(langId)->getName()`): inactive countries are skipped unless their code is `$keepCode` (the stored value must stay selectable).
order()  : array<string, string>
translatedName()  : string|null

Constants

Methods

fromEntities()

Options from country entities (`getCountryCode()`, `getActive()`, `getTranslation(langId)->getName()`): inactive countries are skipped unless their code is `$keepCode` (the stored value must stay selectable).

public static fromEntities(iterable<string|int, mixed> $countries, int|null $languageId[, string|null $keepCode = null ]) : array<string, string>
Parameters
$countries : iterable<string|int, mixed>
$languageId : int|null
$keepCode : string|null = null
Return values
array<string, string>

order()

public static order(array<string, string> $namesByCode) : array<string, string>
Parameters
$namesByCode : array<string, string>

ISO code → name in the UI language

Return values
array<string, string> —

ISO code → name, preferred codes first

translatedName()

private static translatedName(object $country, int|null $languageId) : string|null
Parameters
$country : object
$languageId : int|null
Return values
string|null
On this page

Search results