mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #7471] Fix parameter value processing for objects with unloaded metadata #10503
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/7471
State: closed
Merged: Yes
When binding an object as query parameter, the query object normally tries to convert this object into its identifier. This however only happened if class metadata for the object was already loaded. If it wasn't loaded, conversion was skipped leading to wrong results. While
getMetadataForis more performance sensitive thanhasMetadataFor, we may not assumed that metadata for the bound object has been loaded yet.The code has been changed to no longer check the metadata factory and call
UnitOfWork::getSingleIdentifierValuedirectly, ignoring any mapping exception in the process. This preserves behaviour where binding any unmapped object to a query will send the entire object to the database.