protected static function _sortObjects(&$a, &$b) { $key = self::$sortKey; for ($i = 0, $count = count($key); $i < $count; $i++) { if (isset(self::$sortDirection[$i])) { $direction = self::$sortDirection[$i]; } if (isset(self::$sortCase[$i])) { $caseSensitive = self::$sortCase[$i]; } if (isset(self::$sortLocale[$i])) { $locale = self::$sortLocale[$i]; } $va = $a->{$key}[$i]; $vb = $b->{$key}[$i]; if ((is_bool($va) or is_numeric($va)) and (is_bool($vb) or is_numeric($vb))) { $cmp = $va - $vb; } elseif ($caseSensitive) { $cmp = MString::strcmp($va, $vb, $locale); } else { $cmp = MString::strcasecmp($va, $vb, $locale); } if ($cmp > 0) { return $direction; } if ($cmp < 0) { return -$direction; } } return 0; }