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-Many-Relation: How to add details?


Go to End


2 Posts   3093 Views

Avatar
NicolasLeuenberger

Community Member, 11 Posts

2 March 2009 at 10:36am

Hi,

I'm building a homepage for our actors group. I've got a page class ActorPage on which I display a list of the plays this actor has been in. To do this, I've installed a many-many-relation to the PlayPage class.
So far so good, this works.

But now I would like to add additional information to this relation: Which was the team members role?
I have no idea how to achieve this. I guess the information should be stored in the playpage_actorpages table in the database where the relation is stored. But is there a way to write to that database?

Any help is appreciated.

Thanks, Nicolas

Avatar
dospuntocero

Community Member, 54 Posts

5 March 2009 at 12:19am

Hi Nicolas, you need to store the additional data using DataObjects, look in the tutorial for dataobjects - relationships

good luck!