DateTimeImmutableToDateTimeTransformer
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
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 |
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 |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeImmutableToDateTimeTransformer.html