Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Data Model Questions

Many_to_many, additional information in the join table


Reply

5 Posts   1034 Views

Avatar
katja

28 January 2011 at 2:44am Community Member, 46 Posts

Hi,

I have a many to many relationship between two DataObjects. So in the database I have a table called Object1_Object2 that stores the two IDs of each of the objects. Is there a way I can store in this table a description of the relationship between the two?

And how can this be represented in a class?

Can anybody point me in the right direction?

Thanks,
Katja

Avatar
swaiba

28 January 2011 at 3:33am Forum Moderator, 1796 Posts

I haven't used it, but I believe "many_many_extraFields" on DataObject is what you are looking for.

Avatar
katja

28 January 2011 at 3:45am Community Member, 46 Posts

Thanks for the quick reply! And from Bristol ;)

That sounds like it's the right thing, I will look into that right now.

P.S. Do you know any other SilverStripe people in Bristol? Maybe could meet up sometime?

Thanks again,
Katja

Avatar
swaiba

28 January 2011 at 3:58am Forum Moderator, 1796 Posts

Yar! there are three of us in the office and I know of one other freelancer who lives here - I'll bet there are more because of the number of web agencies here. I previously suggested a meet up (as I've been to the London meetups but they are quite a trip!) - so I am very interested to meet and discuss silverstripe :)

Barry

Avatar
katja

28 January 2011 at 4:01am Community Member, 46 Posts

Yes, I've been to some of those, but not at the same time. I'll email ;)