mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-2749: Error creating Hash in UnitOfWork::addToIdentityMap when composite key contains \DateTime object #3441
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 18, 2013).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user frederes:
I have an Entity with a composite key that includes a \DateTime object.
When persisting my entity i have this error :
[Symfony\Component\Debug\Exception\ContextErrorException]
Catchable Fatal Error: Object of class DateTime could not be converted to string in ..\Symfony\vendor\doctrine\orm\lib\Doctrine\ORM\UnitOfWork.php line 1345
Problem is due to \DateTime object not having a **toString() equivalent. In such case, testing if \DateTime and creating a timestamp from this \DateTime may solve this ?
@doctrinebot commented on GitHub (Oct 18, 2013):
Comment created by frederes:
My entity class definition
@doctrinebot commented on GitHub (Oct 18, 2013):
Comment created by @ocramius:
Duplicate of DDC-1780 DDC-2724
@doctrinebot commented on GitHub (Oct 18, 2013):
Issue was closed with resolution "Duplicate"