mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #10508] Fix id hash of entity with enum as identifier #12412
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?
Original Pull Request: https://github.com/doctrine/orm/pull/10508
State: closed
Merged: Yes
Current situation
When an entity have a backed enum as identifier, Unit Of Work tries to cast to string when generating the hash of the id.
Error "Object of class MyEnum could not be converted to string"Suggested fix
This PR fixes the problem by adding function to get id of entity with backed enum check.
Tests added
It seems tests for this feature were completely missing, so I added them.
Fixes https://github.com/doctrine/orm/issues/10471
Fixes https://github.com/doctrine/orm/issues/10334