DDC-2084: EM#find() with association as PK #2628

Closed
opened 2026-01-22 13:58:40 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Oct 16, 2012).

Jira issue originally created by user nikita2206:

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?

Originally created by @doctrinebot on GitHub (Oct 16, 2012). Jira issue originally created by user nikita2206: 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?
admin added the Bug label 2026-01-22 13:58:40 +01:00
admin closed this issue 2026-01-22 13:58:42 +01:00
Author
Owner

@doctrinebot commented on GitHub (Nov 6, 2012):

Comment created by @FabioBatSilva:

Fixed : d6d5c341e2

@doctrinebot commented on GitHub (Nov 6, 2012): Comment created by @FabioBatSilva: Fixed : https://github.com/doctrine/doctrine2/commit/d6d5c341e220ff7aec50c8ecabd5d0b8be2e0804
Author
Owner

@doctrinebot commented on GitHub (Nov 6, 2012):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Nov 6, 2012): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Nov 6, 2012):

Comment created by nikita2206:

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

@doctrinebot commented on GitHub (Nov 6, 2012): Comment created by nikita2206: What about composite keys? AFAIS, this code checks if id is object, but it could be an array of objects.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2628