mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Embeddables not correctly compared in WHERE clause of DQL #7209
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 @coztymit on GitHub (Aug 9, 2023).
While working with Doctrine and its feature of embeddables, I have encountered an issue regarding DQL and the way it treats embedded objects in the WHERE clause.
I've encountered an issue with Doctrine ORM when trying to use an embeddable object in a DQL
WHEREclause.Current Behavior:
When trying to use the following DQL query:
SELECT i FROM Identity i WHERE i.email = :emailwhere email is an embeddable object, Doctrine doesn't seem to handle the comparison of the whole embeddable object.
To get it to work, I currently have to access the individual fields of the embeddable object:
SELECT i FROM Identity i WHERE i.email.value = :email->value()Expected Behavior:
Ideally, Doctrine ORM should be able to handle the comparison of the entire embeddable object in DQL.
Environment:
doctrine/doctrine-bundle: ^2.10
doctrine/doctrine-migrations-bundle: ^3.2
doctrine/orm: ^2.15.4
I hope this issue can be addressed in future releases. Thank you for the great work you do with Doctrine.