[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


 Description   

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?



 Comments   
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 Wed Sep 02 17:51:19 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.