class DateTimeImmutableToDateTimeTransformer implements DataTransformerInterface

Transforms between a DateTimeImmutable object and a DateTime object.

Methods

mixed
transform(mixed $value)

Transforms a DateTimeImmutable into a DateTime object.

mixed
reverseTransform(mixed $value)

Transforms a DateTime object into a DateTimeImmutable object.

Details

at line 33
mixed transform(mixed $value)

Transforms a DateTimeImmutable into a DateTime object.

Parameters

mixed $value The value in the original representation

Return Value

mixed The value in the transformed representation

Exceptions

TransformationFailedException If the given value is not a \DateTimeImmutable

at line 55
mixed reverseTransform(mixed $value)

Transforms a DateTime object into a DateTimeImmutable object.

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 \DateTime