|Properties in link tables||Samuel W. Knowlton||7/29/12 9:34 AM|
Just a quick question that I couldn't figure out how to search for, so apologies if this has come up before.
I have a table of users and a table of certifications. The user entity has a certification property that uses a user_certifications table as its linktable. Everything works great.
My question is: what if i have properties on the join table relating to a particular instance of a user having a certification, e.g. the date of the certification?
Is the answer to just re-do the model to include UserCertification as an intermediary entity and scrap the direct relationship between User and Certification? Or, in other words, only use link tables when the relationship has no intermediary properties?
|Re: [cf-orm-dev] Properties in link tables||QuackFuzed||7/29/12 9:40 AM|
In short, yes.
Rather than having the m2m relationship(s), you'd end up with the intermediary UserCertificiation entity, which would have an m2o relationship with User and an m2o relationship with Certification. It's relatively unlikely that you'd want an o2m to UserCertification on both User and Certification, but certainly doable.
|Re: [cf-orm-dev] Properties in link tables||Samuel W. Knowlton||7/29/12 9:41 AM|
|Re: [cf-orm-dev] Properties in link tables||QuackFuzed||7/29/12 9:51 AM|
No problem. Always glad to help. :-)