Sesha::_sortByNote PHP Méthode

_sortByNote() protected méthode

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