silverstripe/sapphire — pull request #920 by TheFrozenFire (2012-11-03 01:17:56+00:00)
Title: ENHANCEMENT: Add new method "each" to SS_List

Adds a new SS_List::each method, which accepts a callable parameter. This callable is passed each item for the list.

Example usage would be:

SomeObject::get()->filter("ParentID", 0)->each(function($item) {
$item->delete();
});