Sesha::_sortByProperty PHP Method

_sortByProperty() protected method

Comparison function for sorting inventory stock by a property.
protected _sortByProperty ( array $a, array $b ) : integer
$a array Item one.
$b array Item two.
return integer 1 if item one is greater, -1 if item two is greater; 0 if they are equal.
    protected function _sortByProperty($a, $b)
    {
        if ($a[$GLOBALS['_sort_property']] == $b[$GLOBALS['_sort_property']]) {
            return 0;
        }
        return $a[$GLOBALS['_sort_property']] > $b[$GLOBALS['_sort_property']] ? 1 : -1;
    }