Sesha::_sortByStockID PHP Method

_sortByStockID() protected method

Comparison function for sorting inventory stock by id.
protected _sortByStockID ( 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 _sortByStockID($a, $b)
    {
        if ($a['stock_id'] == $b['stock_id']) {
            return 0;
        }
        return $a['stock_id'] > $b['stock_id'] ? 1 : -1;
    }