MINOR update merge info, merged in r87119 (from r88839)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96714 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-01-12 22:49:39 +00:00
parent 51a2eeed15
commit 66c7eb6f10

View File

@ -49,6 +49,19 @@ class Group extends DataObject {
return $doSet; return $doSet;
} }
function getAllChildren() {
$doSet = new DataObjectSet();
if ($children = DataObject::get('Group', 'ParentID = '.$this->ID)) {
foreach($children as $child) {
$doSet->push($child);
$doSet->merge($child->getAllChildren());
}
}
return $doSet;
}
/** /**
* Caution: Only call on instances, not through a singleton. * Caution: Only call on instances, not through a singleton.
* *