PHP Класс Neos\Flow\I18n\LocaleCollection

This class maintans a hierarchical relation between locales. For example, a locale "en_GB" will be a child of a locale "en".
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$localeCollection array The values are Locale objects, and the keys are these locale's tags.
$localeParentCollection array "Searching" is done by the keys, which are locale tags. The key points to the value which is a parent Locale object. If it's not set, there is no parent for given locale, or no parent was searched before.

Открытые методы

Метод Описание
addLocale ( Locale $locale ) : boolean Adds a locale to the collection.
findBestMatchingLocale ( Locale $locale ) : mixed Returns Locale object which represents one of locales installed and which is most similar to the "template" Locale object given as parameter.
getParentLocaleOf ( Locale $locale ) : mixed Returns a parent Locale object of the locale provided.

Описание методов

addLocale() публичный Метод

Adds a locale to the collection.
public addLocale ( Locale $locale ) : boolean
$locale Locale The Locale to be inserted
Результат boolean FALSE when same locale was already inserted before

findBestMatchingLocale() публичный Метод

Returns Locale object which represents one of locales installed and which is most similar to the "template" Locale object given as parameter.
public findBestMatchingLocale ( Locale $locale ) : mixed
$locale Locale The "template" locale to be matched
Результат mixed Existing Locale instance on success, NULL on failure

getParentLocaleOf() публичный Метод

The parent is a locale which is more generic than the one given as parameter. For example, the parent for locale en_GB will be locale en, of course if it exists in the locale tree of available locales. This method returns NULL when no parent locale is available, or when Locale object provided is not in the tree (ie it's not in a group of available locales). Note: to find a best-matching locale to one which doesn't exist in the system, please use findBestMatchingLocale() method of this class.
public getParentLocaleOf ( Locale $locale ) : mixed
$locale Locale The Locale to search parent for
Результат mixed Existing Locale instance or NULL on failure

Описание свойств

$localeCollection защищенное свойство

The values are Locale objects, and the keys are these locale's tags.
protected array $localeCollection
Результат array

$localeParentCollection защищенное свойство

"Searching" is done by the keys, which are locale tags. The key points to the value which is a parent Locale object. If it's not set, there is no parent for given locale, or no parent was searched before.
protected array $localeParentCollection
Результат array