Jump to:

23480 Posts in 18951 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » ManyManyList add method

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 204 Views
  • michael_geeky
    Avatar
    Community Member
    10 Posts

    ManyManyList add method Link to this post

    Hi,

    I know ManyManyList::add() will change the relation table, but what I am actually after is a way to simply add a new relation to the result list rather than change the table. I have a many_many table and I want to retrieve say, 3 records, but I only get 2 records (obj2) from $obj1->obj2s(), so I want to add a new obj2 from Obj2::get(), add add it to the manymanyList result.

    Cheers!

  • michael_geeky
    Avatar
    Community Member
    10 Posts

    Re: ManyManyList add method Link to this post

    Ok, I figured it out myself. Using an ArrayList instead.

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