Jump to:

3460 Posts in 1064 Topics by 739 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Many_many or Has_many relationships

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

Page: 1
Go to End
Author Topic: 881 Views
  • zenmonkey
    Community Member
    528 Posts

    Many_many or Has_many relationships Link to this post

    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?

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.