[DDC-2084] EM#find() with association as PK Created: 16/Oct/12  Updated: 08/Sep/13  Resolved: 06/Nov/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: Git Master
Fix Version/s: 2.4
Security Level: All

Type: Bug Priority: Major
Reporter: Nikita Nefedov Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None


Say I have a association as primary key in my entity, and I want to find it by id.
I'm calling EntityManager#find("MyEntity1", MyEntity2 $entity),
then it calls UnitOfWork#tryGetById() wich makes implode of sorted ids, and that is error, because sortedId contains object.

I can implement __toString in my entity, but I think this is work of ORM.
What are your thoughts?
I could fix that, but is there some instruction on Doctrine's workflow?

Comment by Fabio B. Silva [ 06/Nov/12 ]

Fixed : https://github.com/doctrine/doctrine2/commit/d6d5c341e220ff7aec50c8ecabd5d0b8be2e0804

Comment by Nikita Nefedov [ 06/Nov/12 ]

What about composite keys? AFAIS, this code checks if id is object, but it could be an array of objects.

Generated at Mon Mar 30 07:22:51 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.