Permalink
Browse files

replacing item customize with single index field in GroupedBy sets

  • Loading branch information...
1 parent ee56f81 commit 819536c2765cdf66c98b02bb118ae89551cc18da @maetl committed Mar 3, 2011
Showing with 5 additions and 4 deletions.
  1. +5 −4 core/model/DataObjectSet.php
@@ -727,13 +727,14 @@ public function groupBy($index) {
*/
public function GroupedBy($index, $childControl = "Children") {
$grouped = $this->groupBy($index);
- $groupedAsSet = new DataObjectSet();
+ $children = array();
foreach($grouped as $group) {
- $groupedAsSet->push($group->First()->customise(array(
+ $children[] = array(
+ $index => $group->First()->$index,
$childControl => $group
- )));
+ );
}
- return $groupedAsSet;
+ return new DataObjectSet($children);
}
/**

2 comments on commit 819536c

I found this from the Forum. Is there any reason this wasn't committed to the core?

Owner

maetl replied Jul 13, 2013

@mattclegg — see the notes on silverstripe#7

Please sign in to comment.