function comparePositionTo(\CharlotteDunois\Yasmin\Models\Role $role) {
        if($this->position === $role->position) {
            return $role->id <=> $this->id;
        }
        
        return $this->position <=> $role->position;
    }
function comparePositionTo(\CharlotteDunois\Yasmin\Models\Role $role) {
        if($this->position === $role->position) {
            return $role->id <=> $this->id;
        }
        
        return $this->position <=> $role->position;
    }
function comparePositionTo ( \ CharlotteDunois \ Yasmin \ Models \ Role $ role ) { if ( $ this -> position === $ role -> position ) { return $ role -> id <=> $ this -> id ; } return $ this -> position <=> $ role -> position ; }
Compares the position from the role to the given role.
@param \CharlotteDunois\Yasmin\Models\Role  $role
@return int
Compares the position from the role to the given role .