mirror of
https://github.com/yiisoft/yii.git
synced 2026-03-03 06:44:07 +01:00
(Fixes issue 1653)
This commit is contained in:
@@ -110,13 +110,19 @@ class CArrayDataProvider extends CDataProvider
|
||||
if(empty($directions))
|
||||
return;
|
||||
$args=array();
|
||||
$dummy=array();
|
||||
foreach($directions as $name=>$descending)
|
||||
{
|
||||
$column=array();
|
||||
foreach($this->rawData as $index=>$data)
|
||||
$column[$index]=is_object($data) ? $data->$name : $data[$name];
|
||||
$args[]=$column;
|
||||
$args[]=$descending ? SORT_DESC : SORT_ASC;
|
||||
$args[]=&$column;
|
||||
$dummy[]=&$column;
|
||||
unset($column);
|
||||
$direction=$descending ? SORT_DESC : SORT_ASC;
|
||||
$args[]=&$direction;
|
||||
$dummy[]=&$direction;
|
||||
unset($direction);
|
||||
}
|
||||
$args[]=&$this->rawData;
|
||||
call_user_func_array('array_multisort', $args);
|
||||
|
||||
Reference in New Issue
Block a user