PHP 클래스 Neos\Flow\I18n\Cldr\Reader\DatesReader

This is not full implementation of features from CLDR. These are missing: - support for other calendars than Gregorian - some data from "dates" tag is not used (fields, timeZoneNames)
또한 보기: http://www.unicode.org/reports/tr35/#Date_Elements
또한 보기: http://www.unicode.org/reports/tr35/#Date_Format_Patterns
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$cache Neos\Cache\Frontend\VariableFrontend
$cldrRepository Neos\Flow\I18n\Cldr\CldrRepository
$localizedLiterals array Locale tags are keys for this array. Values are arrays of literals, i.e. names defined in months, days, quarters etc tags.
$maxLengthOfSubformats array For example, era (G) can be defined in three formats, abbreviated (G, GG, GGG), wide (GGGG), or narrow (GGGGG), so maximal length is set to 5. When length is set to zero, it means that corresponding format has no maximal length.
$parsedFormats array Example of data stored in this array: 'HH:mm:ss zzz' => array( 'HH', array(':'), 'mm', array(':'), 'ss', array(' '), 'zzz', ); Please note that subformats are stored as array elements, and literals are stored as one-element arrays in the same array. Order of elements in array is important.
$parsedFormatsIndices array As for one locale there can be defined many formats (at most 2 format types supported by this class - date, time - multiplied by at most 4 format lengths - full, long, medium, short), references are organized in arrays. Example of data stored in this array: 'pl' => array( 'date' => array( 'full' => 'EEEE, d MMMM y', ... ), ... );

공개 메소드들

메소드 설명
getLocalizedLiteralsForLocale ( Locale $locale ) : array Returns literals array for locale provided.
initializeObject ( ) : void Constructs the reader, loading parsed data from cache if available.
injectCache ( Neos\Cache\Frontend\VariableFrontend $cache ) : void Injects the Flow_I18n_Cldr_Reader_DatesReader cache
injectCldrRepository ( CldrRepository $repository ) : void
parseCustomFormat ( string $format ) : array Returns parsed date or time format string provided as parameter.
parseFormatFromCldr ( Locale $locale, string $formatType, string $formatLength ) : array Returns parsed date or time format basing on locale and desired format length.
shutdownObject ( ) : void Shutdowns the object, saving parsed format strings to the cache.
validateFormatLength ( string $formatLength ) : void Validates provided format length and throws exception if value is not allowed.
validateFormatType ( string $formatType ) : void Validates provided format type and throws exception if value is not allowed.

보호된 메소드들

메소드 설명
parseFormat ( string $format ) : array Parses a date / time format (with syntax defined in CLDR).
parseLocalizedEras ( CldrModel $model ) : array Parses "eras" child of "dates" node and returns it's array representation.
parseLocalizedLiterals ( CldrModel $model, string $literalType ) : array Parses one CLDR child of "dates" node and returns it's array representation.
prepareDateAndTimeFormat ( string $format, Locale $locale, string $formatLength ) : array Creates one parsed datetime format from date and time formats merged together.

메소드 상세

getLocalizedLiteralsForLocale() 공개 메소드

If array was not generated earlier, it will be generated and cached.
public getLocalizedLiteralsForLocale ( Locale $locale ) : array
$locale Neos\Flow\I18n\Locale
리턴 array An array with localized literals

initializeObject() 공개 메소드

Constructs the reader, loading parsed data from cache if available.
public initializeObject ( ) : void
리턴 void

injectCache() 공개 메소드

Injects the Flow_I18n_Cldr_Reader_DatesReader cache
public injectCache ( Neos\Cache\Frontend\VariableFrontend $cache ) : void
$cache Neos\Cache\Frontend\VariableFrontend
리턴 void

injectCldrRepository() 공개 메소드

public injectCldrRepository ( CldrRepository $repository ) : void
$repository Neos\Flow\I18n\Cldr\CldrRepository
리턴 void

parseCustomFormat() 공개 메소드

Returns parsed date or time format string provided as parameter.
public parseCustomFormat ( string $format ) : array
$format string Format string to parse
리턴 array An array representing parsed format

parseFormat() 보호된 메소드

Not all features from CLDR specification are implemented. Please see the documentation for this class for details what is missing.
또한 보기: DatesReader::$parsedFormats
protected parseFormat ( string $format ) : array
$format string
리턴 array Parsed format

parseFormatFromCldr() 공개 메소드

When third parameter ($formatLength) equals 'default', default format for a locale will be used.
public parseFormatFromCldr ( Locale $locale, string $formatType, string $formatLength ) : array
$locale Neos\Flow\I18n\Locale
$formatType string A type of format (one of constant values)
$formatLength string A length of format (one of constant values)
리턴 array An array representing parsed format

parseLocalizedEras() 보호된 메소드

Parses "eras" child of "dates" node and returns it's array representation.
protected parseLocalizedEras ( CldrModel $model ) : array
$model Neos\Flow\I18n\Cldr\CldrModel CldrModel to read data from
리턴 array An array with localized literals for "eras" node

parseLocalizedLiterals() 보호된 메소드

Many children of "dates" node have common structure, so one method can be used to parse them all.
protected parseLocalizedLiterals ( CldrModel $model, string $literalType ) : array
$model Neos\Flow\I18n\Cldr\CldrModel CldrModel to read data from
$literalType string One of: month, day, quarter, dayPeriod
리턴 array An array with localized literals for given type

prepareDateAndTimeFormat() 보호된 메소드

The dateTime format from CLDR looks like "{0} {1}" and denotes where to place time and date, and what literals should be placed before, between and / or after them.
protected prepareDateAndTimeFormat ( string $format, Locale $locale, string $formatLength ) : array
$format string DateTime format
$locale Neos\Flow\I18n\Locale Locale to use
$formatLength string A length of format (full, long, medium, short) or 'default' to use default one from CLDR
리턴 array Merged formats of date and time

shutdownObject() 공개 메소드

Shutdowns the object, saving parsed format strings to the cache.
public shutdownObject ( ) : void
리턴 void

validateFormatLength() 공개 정적인 메소드

Validates provided format length and throws exception if value is not allowed.
public static validateFormatLength ( string $formatLength ) : void
$formatLength string
리턴 void

validateFormatType() 공개 정적인 메소드

Validates provided format type and throws exception if value is not allowed.
public static validateFormatType ( string $formatType ) : void
$formatType string
리턴 void

프로퍼티 상세

$cache 보호되어 있는 프로퍼티

protected VariableFrontend,Neos\Cache\Frontend $cache
리턴 Neos\Cache\Frontend\VariableFrontend

$cldrRepository 보호되어 있는 프로퍼티

protected CldrRepository,Neos\Flow\I18n\Cldr $cldrRepository
리턴 Neos\Flow\I18n\Cldr\CldrRepository

$localizedLiterals 보호되어 있는 프로퍼티

Locale tags are keys for this array. Values are arrays of literals, i.e. names defined in months, days, quarters etc tags.
protected array $localizedLiterals
리턴 array

$maxLengthOfSubformats 보호되어 있는 정적으로 프로퍼티

For example, era (G) can be defined in three formats, abbreviated (G, GG, GGG), wide (GGGG), or narrow (GGGGG), so maximal length is set to 5. When length is set to zero, it means that corresponding format has no maximal length.
protected static array $maxLengthOfSubformats
리턴 array

$parsedFormats 보호되어 있는 프로퍼티

Example of data stored in this array: 'HH:mm:ss zzz' => array( 'HH', array(':'), 'mm', array(':'), 'ss', array(' '), 'zzz', ); Please note that subformats are stored as array elements, and literals are stored as one-element arrays in the same array. Order of elements in array is important.
protected array $parsedFormats
리턴 array

$parsedFormatsIndices 보호되어 있는 프로퍼티

As for one locale there can be defined many formats (at most 2 format types supported by this class - date, time - multiplied by at most 4 format lengths - full, long, medium, short), references are organized in arrays. Example of data stored in this array: 'pl' => array( 'date' => array( 'full' => 'EEEE, d MMMM y', ... ), ... );
protected array $parsedFormatsIndices
리턴 array