Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Sorting within a many_many-relation

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 2316 Views
  • Steven
    Avatar
    Community Member
    6 Posts

    Sorting within a many_many-relation Link to this post

    Hi there,

    I probably have got a really novice question, but I wasn't able to find anything about that:

    How can I sort the output of a n:n-relation? I my specific case I've got a catalog, including categories and products. Each product can be assigned to multiple categories.

    It is no problem to sort a 1:n-relation via DataObject::get(...). But using the n:n-relation, there is one more table to manage and I don't know, how to include it into my query.

    Steven

  • Steven
    Avatar
    Community Member
    6 Posts

    Re: Sorting within a many_many-relation Link to this post

    ok, I fixed it by redeclaring the JOIN-Term.
    I was trying to (re)use that JOIN, silverstripe is extracting out of the relation-definition.

    Steven

    2316 Views
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.