matchingAssocationFieldRequiresObject not triggerd with IN() #5399

Closed
opened 2026-01-22 15:06:27 +01:00 by admin · 2 comments
Owner

Originally created by @michsk on GitHub (Jan 27, 2017).

So not sure if this is a bug. For me it's actually handy because now i can still filter the Entities.

But when i try to filter on a relation's id with using a Criteria and the EQ expression i get the exception matchingAssocationFieldRequiresObject. But when i filter with a IN expression everything works as expected. Is this by design ?

Additionally, is there any other way to use EQ expression for filtering by relation id

Originally created by @michsk on GitHub (Jan 27, 2017). So not sure if this is a bug. For me it's actually handy because now i can still filter the Entities. But when i try to filter on a relation's id with using a Criteria and the EQ expression i get the exception matchingAssocationFieldRequiresObject. But when i filter with a IN expression everything works as expected. Is this by design ? Additionally, is there any other way to use EQ expression for filtering by relation id
admin closed this issue 2026-01-22 15:06:28 +01:00
Author
Owner

@oleg-andreyev commented on GitHub (Mar 5, 2020):

I've encountered the same behaviors.

Tagging "core" contributors
@beberlei @SenseException @jwage @lcobucci @guilhermeblanco @greg0ire @Ocramius maybe they have ideas/knowledge why it was done like so initially

It seems that it's related to DDC-2430 (https://github.com/doctrine/orm/issues/3145)

@oleg-andreyev commented on GitHub (Mar 5, 2020): I've encountered the same behaviors. Tagging "core" contributors @beberlei @SenseException @jwage @lcobucci @guilhermeblanco @greg0ire @Ocramius maybe they have ideas/knowledge why it was done like so initially It seems that it's related to DDC-2430 (https://github.com/doctrine/orm/issues/3145)
Author
Owner

@greg0ire commented on GitHub (Mar 6, 2020):

It's hard to understand what this is about: https://github.com/doctrine/orm/search?q=matchingAssocationFieldRequiresObject&unscoped_q=matchingAssocationFieldRequiresObject

I think I won't be able to help anyways, but I think this should come with a stack trace and sample code. And since this is more of a question, please go ask it on Stack Overflow, a place where people get downvoted when they are imprecise :trollface: Link to the question here, and if you can't get an answer tell me, I will spend some reputation to set a bounty on it.

@greg0ire commented on GitHub (Mar 6, 2020): It's hard to understand what this is about: https://github.com/doctrine/orm/search?q=matchingAssocationFieldRequiresObject&unscoped_q=matchingAssocationFieldRequiresObject I think I won't be able to help anyways, but I think this should come with a stack trace and sample code. And since this is more of a question, please go ask it on Stack Overflow, a place where people get downvoted when they are imprecise :trollface: Link to the question here, and if you can't get an answer tell me, I will spend some reputation to set a bounty on it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5399