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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Many_to_many, additional information in the join table


Go to End


5 Posts   1547 Views

Avatar
katja

Community Member, 46 Posts

28 January 2011 at 2:44am

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

Forum Moderator, 1899 Posts

28 January 2011 at 3:33am

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

Avatar
katja

Community Member, 46 Posts

28 January 2011 at 3:45am

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

Forum Moderator, 1899 Posts

28 January 2011 at 3:58am

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

Community Member, 46 Posts

28 January 2011 at 4:01am

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