DataList has a removeAll() method, but no writeAll() method.

41 views
Skip to first unread message

simone...@silverstripe.com

unread,
Feb 28, 2016, 6:44:06 PM2/28/16
to SilverStripe Core Development
I think it's kind of odd there's no writeAll() method but there is a removeAll().

It makes sense to have both, maybe even an updateAll() in case there's a bulk-update?

simone...@silverstripe.com

unread,
Feb 28, 2016, 11:35:44 PM2/28/16
to SilverStripe Core Development
Sorry, ArrayList could use a writeAll() ofcourse, not DataList.

James Turner

unread,
Feb 29, 2016, 4:10:33 PM2/29/16
to SilverStripe Core Development
I don't think it would make sense to have it on ArrayList as there is no restriction that the items in the list are DataObjects.

I think it would make more sense on DataList where we already have bulk manipulation like removeAll, removing all the items from the DB (vs ArrayList removeAll which just removes from the array).

As for updateAll, the write method on DataObjects does both inserts and updates so it would be unnecessary.
Reply all
Reply to author
Forward
0 new messages