mirror of
https://github.com/doctrine/orm.git
synced 2026-04-24 06:58:19 +02:00
DDC-640: Changes to datetime property not persisting #792
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?
Originally created by @doctrinebot on GitHub (Jun 16, 2010).
Jira issue originally created by user garrett:
I've got an entity with a property declared as follows:
Changes made to this property via PHP's DateTime::setTime function do not persist
In order to persist the changes I must do the following
@doctrinebot commented on GitHub (Jun 16, 2010):
Comment created by romanb:
DateTime objects are treated as (immutable) value objects. To change a date, set a new date instead of "mutating" the existing date. The fact that DateTime is mutable is considered bad design. Dates dont change. When you change a date you get a new date.
@doctrinebot commented on GitHub (Jun 16, 2010):
Comment created by garrett:
Fair enough. Couldn't find any documentation on this hence the report. Sorry for the interruption.
@doctrinebot commented on GitHub (Jun 16, 2010):
Issue was closed with resolution "Invalid"