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 or Has_many relationships


Go to End


1639 Views

Avatar
zenmonkey

Community Member, 545 Posts

30 September 2009 at 6:05am

I'm having trouble with creating the right relationship.

I have a Product Page Type and Top10 Page Type

The site will have multiple Top 10 pages each with Multiple Products Linked to It. Any Given Product Page can be inked to more than one Top10 Page. The kicker is I need a way to order the products on the Top10 pages. So each top 10 page could have Number10, Number9 object etc.

Would the best way be to create Each Rank as a DataObject,

Each Rank would has_one Product Page
Each Top10 Page would has_one Each Rank
Each Product would has_many Each Rank
Each Top10 Page many_many Products
Each Product belongs_many_many Top10

Does that make sense?