Jump to:

3460 Posts in 1064 Topics by 739 members

Data Model Questions

SilverStripe Forums » Data Model Questions » sorting by two parameters

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

Page: 1
Go to End
Author Topic: 1046 Views
  • Victor
    Avatar
    Community Member
    128 Posts

    sorting by two parameters Link to this post

    I want to sort by two parameters like in SQL "... ORDER BY `lastname`,'firstname`" but it seem not to work and I cannot find documentation

    Thank you in advance. Victor

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: sorting by two parameters Link to this post

    This should work:

    $records = DataObject::get("SomeObject", "","SortFieldA ASC, SortFieldB ASC");

  • Victor
    Avatar
    Community Member
    128 Posts

    Re: sorting by two parameters Link to this post

    Yes, I found it. But on my way to find I found a strange error.
    Thanks

    Victor

    1046 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.