I have a entity Item
and another one is ItemReferral
Item
is associated as oneToMany
with ItemReferral
ItemReferral
table has item_id
and user_id
fields
It's working already.
Now when I fetch items then I get all ItemReferrals
of items but I want to control associated ItemReferral
s to specific user_id
.
For example:
Item
with id 10 has many ItemReferral
s with (item_id
10, user_id
1, item_id
10 user_id
2) but in association result I want to get ItemReferral
of user_id
1 for each item, how to achieve this ?