SideMenuModule::_Compare PHP Method

_Compare() protected method

protected _Compare ( $A, null $B = null ) : integer | void
$A
$B null
return integer | void
        protected function _Compare($A, $B = null)
        {
            static $Groups;
            if ($B === null) {
                $Groups = $A;
                return;
            }
            $SortA = $this->_CompareSort($A, $Groups);
            $SortB = $this->_CompareSort($B, $Groups);
            if ($SortA > $SortB) {
                return 1;
            } elseif ($SortA < $SortB) {
                return -1;
            } elseif ($A['_Sort'] > $B['_Sort']) {
                // fall back to order added
                return 1;
            } elseif ($A['_Sort'] < $B['_Sort']) {
                return -1;
            } else {
                return 0;
            }
        }