DateTimeToRfc3339Transformer

class DateTimeToRfc3339Transformer extends BaseDateTimeTransformer Methods __construct(string $inputTimezone = null, string $outputTimezone = null) Constructor. from BaseDateTimeTransformer mixed transform(DateTimeInterface $dateTime) Transforms a normalized date into a localized date. mixed reverseTransform(string $rfc3339) Transforms a formatted string following RFC 3339 into a normalized date. Details __construct(string $inputTimezone = null, st

DateTimeToLocalizedStringTransformer::transform()

mixed transform(DateTimeInterface $dateTime) Transforms a normalized date into a localized date string/array. Parameters DateTimeInterface $dateTime A DateTimeInterface object Return Value mixed The value in the transformed representation Exceptions TransformationFailedException If the given value is not a \DateTimeInterface or if the date could not be transformed.

DateTimeToLocalizedStringTransformer::reverseTransform()

mixed reverseTransform(mixed $value) Transforms a localized date string/array into a normalized date. Parameters mixed $value The value in the transformed representation Return Value mixed The value in the original representation Exceptions TransformationFailedException if the given value is not a string, if the date could not be parsed

DateTimeToLocalizedStringTransformer

class DateTimeToLocalizedStringTransformer extends BaseDateTimeTransformer Transforms between a normalized time and a localized time string. Methods __construct(string $inputTimezone = null, string $outputTimezone = null, int $dateFormat = null, int $timeFormat = null, int $calendar = \IntlDateFormatter::GREGORIAN, string $pattern = null) Constructor. mixed transform(DateTimeInterface $dateTime) Transforms a normalized date into a localized date string/array. mixed reverseTrans

DateTimeToArrayTransformer::transform()

mixed transform(DateTimeInterface $dateTime) Transforms a normalized date into a localized date. Parameters DateTimeInterface $dateTime A DateTimeInterface object Return Value mixed The value in the transformed representation Exceptions TransformationFailedException If the given value is not a \DateTimeInterface

DateTimeToArrayTransformer::reverseTransform()

mixed reverseTransform(mixed $value) Transforms a localized date into a normalized date. Parameters mixed $value The value in the transformed representation Return Value mixed The value in the original representation Exceptions TransformationFailedException If the given value is not an array, if the value could not be transformed

DateTimeToArrayTransformer

class DateTimeToArrayTransformer extends BaseDateTimeTransformer Transforms between a normalized time and a localized time string/array. Methods __construct(string $inputTimezone = null, string $outputTimezone = null, array $fields = null, bool $pad = false) Constructor. mixed transform(DateTimeInterface $dateTime) Transforms a normalized date into a localized date. mixed reverseTransform(mixed $value) Transforms a localized date into a normalized date. Details

DateTimeNormalizer::supportsNormalization()

bool supportsNormalization(mixed $data, string $format = null) Checks whether the given class is supported for normalization by this normalizer. Parameters mixed $data Data to normalize. string $format The format being (de-)serialized from or into. Return Value bool

DateTimeNormalizer::supportsDenormalization()

bool supportsDenormalization(mixed $data, string $type, string $format = null) Checks whether the given class is supported for denormalization by this normalizer. Parameters mixed $data Data to denormalize from. string $type The class to which the data should be denormalized. string $format The format being deserialized from. Return Value bool

DateTimeNormalizer::normalize()

array|string|bool|int|float|null normalize(object $object, string $format = null, array $context = array()) Normalizes an object into a set of arrays/scalars. Parameters object $object object to normalize string $format format the normalization result will be encoded as array $context Context options for the normalizer Return Value array|string|bool|int|float|null