Sesha::_sortByName PHP Method

_sortByName() protected method

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