mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merged revisions 47459 via svnmerge from
http://svn.silverstripe.com/open/modules/sapphire/branches/2.2.1asfonz ........ r47459 | jshipman | 2007-12-21 13:56:40 +1300 (Fri, 21 Dec 2007) | 1 line implemented equal values ........ git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@48537 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
a356bf9181
commit
4e32ae08a3
@ -849,12 +849,19 @@ class DataObjectSet extends ViewableData implements Iterator {
|
||||
$previous = null;
|
||||
foreach($this->items as $key => $item){
|
||||
//check if current item field value equals the next
|
||||
if($item->$field == $previous->$field){
|
||||
|
||||
if($previous && $item->$field == $previous->$field){
|
||||
$item->Ranking = $this->convertIntToRank($count - 1)." equal";
|
||||
$previous->Ranking = $this->convertIntToRank($count - 1)." equal";
|
||||
if($skipduplicates){
|
||||
$count++;
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
$item->Ranking = $this->convertIntToRank($count);
|
||||
$count++;
|
||||
$count++;
|
||||
}
|
||||
|
||||
$previous = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user