CodeIgniter Forums
DataMapper tertiary relations - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: DataMapper tertiary relations (/showthread.php?tid=47167)



DataMapper tertiary relations - El Forum - 11-28-2011

[eluser]Dracos[/eluser]
Previously I've asked about handling the relations between my app and user models, now there's a third one in the mix. (DM 1.8)

Our apps_users table has some extra fields:

Code:
id
app_id
user_id
contact_id
role
status

The contact_id field is supposed to point to the contact for the user that the app maintains. I've previously made a app_users model to bridge the gap, but I was wondering if there was a way to set up a relation so we could navigate from app to contact via apps_users. This is an edge case that I'm not seeing covered int he DM docs.