PHP Class Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToArrayTransformer

Author: Bernhard Schussek ([email protected])
Author: Florian Eckerstorfer ([email protected])
Inheritance: extends Symfony\Component\Form\Extension\Core\DataTransformer\BaseDateTimeTransformer
显示文件 Open project: pmjones/php-framework-benchmarks Class Usage Examples

Public Methods

Method Description
__construct ( string $inputTimezone = null, string $outputTimezone = null, array $fields = null, boolean $pad = false ) Constructor.
reverseTransform ( array $value ) : DateTime Transforms a localized date into a normalized date.
transform ( DateTime $dateTime ) : array Transforms a normalized date into a localized date.

Method Details

__construct() public method

Constructor.
public __construct ( string $inputTimezone = null, string $outputTimezone = null, array $fields = null, boolean $pad = false )
$inputTimezone string The input timezone
$outputTimezone string The output timezone
$fields array The date fields
$pad boolean Whether to use padding

reverseTransform() public method

Transforms a localized date into a normalized date.
public reverseTransform ( array $value ) : DateTime
$value array Localized date
return DateTime Normalized date

transform() public method

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