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

DateTimeToRfc3339Transformer::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

DateTimeToRfc3339Transformer::reverseTransform()

mixed reverseTransform(string $rfc3339) Transforms a formatted string following RFC 3339 into a normalized date. Parameters string $rfc3339 Formatted string Return Value mixed The value in the original representation Exceptions TransformationFailedException If the given value is not a string, if the value could not be transformed

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.

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

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

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

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

DateTimeNormalizer

class DateTimeNormalizer implements NormalizerInterface, DenormalizerInterface Normalizes an object implementing the {see \DateTimeInterface} to a date string. Denormalizes a date string to an instance of {see \DateTime} or {see \DateTimeImmutable}. Constants FORMAT_KEY Methods __construct(string $format = \DateTime::RFC3339) array|string|bool|int|float|null normalize(object $object, string $format = null, array $context = array()) Normalizes an object into a set of arrays/sc