Skip to content

Commit

Permalink
Renamed $sortby to $sortBy in sortByKey
Browse files Browse the repository at this point in the history
  • Loading branch information
ravage84 committed Oct 23, 2013
1 parent b4a0182 commit c44135a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Cake/basics.php
Expand Up @@ -125,22 +125,22 @@ function debug($var, $showHtml = null, $showFrom = true) {
if (!function_exists('sortByKey')) {

/**
* Sorts given $array by key $sortby.
* Sorts given $array by key $sortBy.
*
* @param array $array Array to sort
* @param string $sortby Sort by this key
* @param string $sortBy Sort by this key
* @param string $order Sort order asc/desc (ascending or descending).
* @param integer $type Type of sorting to perform
* @return mixed Sorted array
* @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#sortByKey
*/
function sortByKey(&$array, $sortby, $order = 'asc', $type = SORT_NUMERIC) {
function sortByKey(&$array, $sortBy, $order = 'asc', $type = SORT_NUMERIC) {
if (!is_array($array)) {
return null;
}

foreach ($array as $key => $val) {
$sa[$key] = $val[$sortby];
$sa[$key] = $val[$sortBy];
}

if ($order === 'asc') {
Expand Down

0 comments on commit c44135a

Please sign in to comment.