Mnemo::_sortByNotepad PHP Метод

_sortByNotepad() защищенный статический Метод

Comparison function for sorting notes by notepad name.
protected static _sortByNotepad ( array $a, array $b ) : integer
$a array Note one.
$b array Note two.
Результат integer 1 if note one is greater, -1 if note two is greater; 0 if they are equal.
    protected static function _sortByNotepad($a, $b)
    {
        $aowner = $a['memolist_id'];
        $bowner = $b['memolist_id'];
        $ashare = $GLOBALS['mnemo_shares']->getShare($aowner);
        $bshare = $GLOBALS['mnemo_shares']->getShare($bowner);
        if ($aowner != $ashare->get('owner')) {
            $aowner = $ashare->get('name');
        }
        if ($bowner != $bshare->get('owner')) {
            $bowner = $bshare->get('name');
        }
        return strcoll($aowner, $bowner);
    }