Welcome Guest, Not a member yet? Register   Sign In
How to have multiple relationships to same model when HAS_ONE in both directions with DMZ?
#3

[eluser]godunov[/eluser]
WanWizard, many thanks for your reply. I have tried a join table but I still need to define the relationships in the models and I don't know how to do that. The problem I have is the one you cited: a card_side is referenced by both a card->front and card->back attribute. How would having a join table solve this? I see a join having the following attributes: id, card_id, front_id, back_id. These are already represented in the cards and card_sides table though, so what does the join table change? My issue is with the relationship definitions in the models.

Basic restating of my simple problem: How would one do what seems like a very common relationship where a Manager, say, has one Secretary and one Chauffeur, and the Secretary and Chauffeur are both Employees, and each has just one Manager (who is not an Employee in my silly example). One-to-one in both directions, but the Manager cites 2 Employees, each with a different name, while each Employee only cites a single Manager. That's the issue, that the Employee (or Card_Side in my problem above) only cites one Manager (or Card). Can anyone show me how the relationships would be defined in the model, whether using a join table or not?


Messages In This Thread
How to have multiple relationships to same model when HAS_ONE in both directions with DMZ? - by El Forum - 11-27-2010, 09:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB