From bf9358ee4665d9294d0240fa8dd4fe9910865e0b Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Wed, 16 Dec 2009 05:37:50 +0000 Subject: [PATCH] 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 --- core/model/DataObjectSet.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/model/DataObjectSet.php b/core/model/DataObjectSet.php index 6313e90f8..d092e0a6d 100644 --- a/core/model/DataObjectSet.php +++ b/core/model/DataObjectSet.php @@ -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.