PHP Class Symfony\Component\Form\ValueTransformer\DateTimeToLocalizedStringTransformer

Options: * "input": The type of the normalized format ("time" or "timestamp"). Default: "datetime" * "output": The type of the transformed format ("string" or "array"). Default: "string" * "format": The format of the time string ("short", "medium", "long" or "full"). Default: "short" * "locale": The locale of the localized string. Default: Result of Locale::getDefault()
Author: Bernhard Schussek ([email protected])
Author: Florian Eckerstorfer ([email protected])
Inheritance: extends Symfony\Component\Form\ValueTransformer\BaseDateTimeTransformer
Mostra file Open project: pmjones/php-framework-benchmarks Class Usage Examples

Public Methods

Method Description
reverseTransform ( string | array $value, $originalValue ) : DateTime Transforms a localized date string/array into a normalized date.
transform ( DateTime $dateTime ) : string | array Transforms a normalized date into a localized date string/array.

Protected Methods

Method Description
configure ( ) {@inheritDoc}
getIntlDateFormatter ( ) : IntlDateFormatter Returns a preconfigured IntlDateFormatter instance

Method Details

configure() protected method

{@inheritDoc}
protected configure ( )

getIntlDateFormatter() protected method

Returns a preconfigured IntlDateFormatter instance
protected getIntlDateFormatter ( ) : IntlDateFormatter
return IntlDateFormatter

reverseTransform() public method

Transforms a localized date string/array into a normalized date.
public reverseTransform ( string | array $value, $originalValue ) : DateTime
$value string | array Localized date string/array
return DateTime Normalized date

transform() public method

Transforms a normalized date into a localized date string/array.
public transform ( DateTime $dateTime ) : string | array
$dateTime DateTime Normalized date.
return string | array Localized date string/array.