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".
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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