mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
UnitOfWork->createEntity: idHash-creation from DateTime fails #6563
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 @roelfsche on GitHub (Oct 28, 2020).
I use a legacy data model, which has a compound primary key, made of a string and a datetime column.
If I try to fetch data as objects, I get an exception
In UnitOfWork.php line 2625:
[ErrorException]
Catchable Fatal Error: Object of class DateTime could not be converted to string
The reason is:
$idHash = implode(' ', $id);and
$id = [ 'date' => DateTime, 'myOtherString' => ....]May be, the "flattenIdentifier" method should recognize DateTime-Fields and cast them to strings?
Thank you.