mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-30: DateTimeType should take into account null as a possible value #41
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 (Oct 2, 2009).
Originally assigned to: @guilhermeblanco on GitHub.
Jira issue originally created by user itoijala:
DateTimeType does not expect the value to be null, both conversions ignore this possibility. This bug is especially annoying when converting from the database to PHP. The user does not expect to get false as a value for a datetime field. False is returned by DateTime when null is given. Null should be returned as the PHP value. Converting to the database from PHP would result in an error, since $value would be null.
Simple fix:
OLD:
NEW:
@doctrinebot commented on GitHub (Oct 3, 2009):
Comment created by itoijala:
The same problem exists in DateType an TimeType as well. The same kind of fix should work.
@doctrinebot commented on GitHub (Oct 3, 2009):
Comment created by @guilhermeblanco:
In changeset http://trac.doctrine-project.org/changeset/6418 I committed a fix to this report!
Thanks for report and patch!
@doctrinebot commented on GitHub (Oct 3, 2009):
Issue was closed with resolution "Fixed"