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.

General Questions

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

ManyManyList add method


2 Posts   215 Views


22 October 2013 at 1:03pm (Last edited: 22 October 2013 1:04pm), Community Member, 10 Posts


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.



22 October 2013 at 1:20pm Community Member, 10 Posts

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