mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-05 07:38:26 +02:00
FEATURE Added DataObjectSet::emptyItems() to remove all the items from the set - this is useful for when you are augmenting CMS and front end fields via updateCMSFields() and updateFrontEndFields() on a DataObjectDecorator (from r94297)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@95593 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f29c079792
commit
bf9358ee46
@ -97,6 +97,13 @@ class DataObjectSet extends ViewableData implements IteratorAggregate, Countable
|
||||
$item->destroy();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all the items in this set.
|
||||
*/
|
||||
public function emptyItems() {
|
||||
$this->items = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert this DataObjectSet to an array of DataObjects.
|
||||
|
Loading…
Reference in New Issue
Block a user