mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[PR #7554] Allow all datetime types to be used as version #10540
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/doctrine/orm/pull/7554
State: closed
Merged: No
I am working on an existing database with fields of type
timestamp. In order to map that to a DateTime object in Doctrine, I've found the solution of adding the@Versionannotation. But I'd really prefer to get a DateTimeImmutable, which is impossible.At the moment a field of type
datetime_immutablewith annotation@Versionwill trigger this following error:I cannot see any reason not to allow any type of datetime to be mapped to a timestamp in database, so this PR allows all of them. Please tell me if i'm missing something.