mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
getReference and typehinting in the Entity fail #5756
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 @michsk on GitHub (Nov 2, 2017).
When i use
getReferenceto use in a filter. I get a Exception because mygetIdis typehinted in the Entity but the value set for the property is a string.Return value of Foo\\Domain\\Entity\\Project\\Project::getId() must be an instance of Foo\\Domain\\Value\\Id\\ProjectId, string returned.@Ocramius commented on GitHub (Nov 2, 2017):
Are you passing the appropriate values to
getReference? The ORM won'tcast them for you, so you are responsible for using the correct types.
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/
On Thu, Nov 2, 2017 at 8:15 AM, Michal-sk notifications@github.com wrote:
@michsk commented on GitHub (Nov 2, 2017):
Ok, wasn't aware of that. Tought the ProxyFactory would ue the anotations in my Entity. Thanks this will fix it than.