def get_trigger_type_db(ref):
    """
    Returns the trigger type object from db given a string ref.

    :param ref: Reference to the trigger type db object.
    :type ref: ``str``

    :rtype trigger_type: ``object``
    """
    try:
        return TriggerType.get_by_ref(ref)
    except StackStormDBObjectNotFoundError as e:
        LOG.debug(
            'Database lookup for ref="%s" resulted ' + "in exception : %s.",
            ref,
            e,
            exc_info=True,
        )

    return None

    Returns the trigger type object from db given a string ref.

    :param ref: Reference to the trigger type db object.
    :type ref: ``str``

    :rtype trigger_type: ``object``
    
st2common/st2common/services/triggers.py