english/libraries/joomla/utilities/arrayhelper.php
/**
	 * Callback function for sorting an array of objects on a key
	 *
	 * @param   array  $a  An array of objects
	 * @param   array  $b  An array of objects
	 *
	 * @return  integer  Comparison status
	 *
	 * @see     JArrayHelper::sortObjects()
	 * @since   11.1
	 */
Callback function for sorting an array of objects on a key
@param   array  $a  An array of objects
@param   array  $b  An array of objects

@return  integer  Comparison status


Callback function for sorting an array of objects on a key @param array $a An array of objects @param array $b An array of objects @return integer Comparison status
protected static function _sortObjects(&$a, &$b)
	{
		$params = $GLOBALS['JAH_so'];
		for ($i = 0, $count = count($params['key']); $i < $count; $i++)
		{
			if (isset($params['direction'][$i])) {
				$direction = $params['direction'][$i];
			}
			if (isset($params['casesensitive'][$i])) {
				$casesensitive = $params['casesensitive'][$i];
			}
			if (isset($params['locale'][$i])) {
				$locale = $params['locale'][$i];
			}
			$va = $a->$params['key'][$i];
			$vb = $b->$params['key'][$i];
			if ((is_bool($va) or is_numeric($va)) and (is_bool($vb) or is_numeric($vb))) {
				$cmp = $va - $vb;
			}
			elseif ($casesensitive) {
				$cmp = JString::strcmp($va, $vb, $locale);
			}
			else {
				$cmp = JString::strcasecmp($va, $vb, $locale);
			}
			if ($cmp > 0) {
				return $direction;
			}
			if ($cmp < 0) {
				return - $direction;
			}
		}
		return 0;
	}
protected static function _sortObjects ( & $ a , & $ b ) { $ params = $ GLOBALS [ 'JAH_so' ] ; for ( $ i = 0 , $ count = count ( $ params [ 'key' ] ) ; $ i < $ count ; $ i ++ ) { if ( isset ( $ params [ 'direction' ] [ $ i ] ) ) { $ direction = $ params [ 'direction' ] [ $ i ] ; } if ( isset ( $ params [ 'casesensitive' ] [ $ i ] ) ) { $ casesensitive = $ params [ 'casesensitive' ] [ $ i ] ; } if ( isset ( $ params [ 'locale' ] [ $ i ] ) ) { $ locale = $ params [ 'locale' ] [ $ i ] ; } $ va = $ a -> $ params [ 'key' ] [ $ i ] ; $ vb = $ b -> $ params [ 'key' ] [ $ i ] ; if ( ( is_bool ( $ va ) or is_numeric ( $ va ) ) and ( is_bool ( $ vb ) or is_numeric ( $ vb ) ) ) { $ cmp = $ va - $ vb ; } elseif ( $ casesensitive ) { $ cmp = JString :: strcmp ( $ va , $ vb , $ locale ) ; } else { $ cmp = JString :: strcasecmp ( $ va , $ vb , $ locale ) ; } if ( $ cmp > 0 ) { return $ direction ; } if ( $ cmp < 0 ) { return - $ direction ; } } return 0 ; }
Callback function for sorting an array of objects on a key
 @param   array  $a  An array of objects
 @param   array  $b  An array of objects
Callback function for sorting an array of objects on a key @param array $a An array of objects @param array $b An array of objects