+ [task#120474] add handling of array object and add comments.
This commit is contained in:
@@ -801,6 +801,15 @@ function debug($message = '', $file = 'undefined', $line = 0)
|
||||
$app->saveError(E_USER_WARNING, $message, $file, $line);
|
||||
}
|
||||
|
||||
/**
|
||||
* 为数组使用字母排序。
|
||||
* Use alphabetical sorting for arrays.
|
||||
*
|
||||
* @param array $data
|
||||
* @param string $fieldName
|
||||
* @param string $suffix
|
||||
* @return void
|
||||
*/
|
||||
function addPrefixToField(&$data, $fieldName, $suffix = '. ')
|
||||
{
|
||||
$key = 0;
|
||||
@@ -817,6 +826,10 @@ function addPrefixToField(&$data, $fieldName, $suffix = '. ')
|
||||
{
|
||||
$item[$fieldName] = $prefix . $suffix . $item[$fieldName];
|
||||
}
|
||||
else
|
||||
{
|
||||
$item->{$fieldName} = $prefix . $suffix . $item->{$fieldName};
|
||||
}
|
||||
$key++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user