def convertToIntOrNegativeOneIfUnset(val=None):
    """
        convertToIntOrNegativeOneIfUnset - Converts value to an integer, or -1 if unset

        @param val <int/str/None> - Value

        Takes a value, if not set returns -1. If not an integer, returns 0
    """
    if val in (None, ''):
        return -1
    try:
        return int(val)
    except:
        return 0
