mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-2487: UnitOfWork::getEntityIdentifier() contains objects when custom mapping types are part of an entity's identity #3121
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 4, 2013).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user benjamin:
I'm using a custom mapping type for a
LocalDateclass (mapped to aDATEfield in the MySQL database).Given the following entity:
When
var_export()-ing the result ofUnitOfWork::getEntityIdentifier()on an instance of this class, the result is similar to:This is a bit weird, because as far as I understand it, it should return the identity as it maps to database fields:
If we take the
$restaurantexample, it returns the restaurant ID, and not theRestaurantentity, so my opinion is that it should be the same for$date.Shouldn't the
UnitOfWorkuseType::convertToDatabaseValue()on custom mapping types to infer their value, when computing the identity of an entity?