mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-3732: Entity with string @id can't be fetches #4580
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 (May 10, 2015).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user peter.zwegat:
I defined an entity id field with the annotation:
It's not possible to fetch the entity neither with
->find()nor manually with a query builder (quoted etc., tried everything).This return just null even if the entity with the given id exists.
When I not quote the passed id value it, I become this error:
'fi'ist just the country identifier here that is the entity id.@doctrinebot commented on GitHub (May 10, 2015):
Comment created by @ocramius:
Quoting parameters explicit is not necessary.
Also, quoting parameters is not needed in DQL, as DQL is translated by looking at mappings anyway.
@doctrinebot commented on GitHub (May 10, 2015):
Issue was closed with resolution "Invalid"
@doctrinebot commented on GitHub (May 10, 2015):
Comment created by peter.zwegat:
Yeah I only quoted the id for test purposes.
I go a step back:
->find('de')throws the exception that I posted in the issue.String Id's are possible normally not?
@doctrinebot commented on GitHub (May 10, 2015):
Comment created by @ocramius:
[~peter.zwegat] yes, it is allowed, but what exception are you getting?
@doctrinebot commented on GitHub (May 11, 2015):
Comment created by peter.zwegat:
This one when I try to find an entity by it's id:
Doctrine\ORM\Query\QueryException: [Semantical Error] line 0, col 121 near 'fi': Error: 'fi' is not defined. (/..../vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php: 63)'fi' is here the key. Just used the
->findmethod.@doctrinebot commented on GitHub (May 11, 2015):
Comment created by @ocramius:
Please show some actual code in a gist - I'm doing guesswork here :-P