def _getView(syn, view_id, clause=None):
    """
    Based on a user-defined query calls to synapse's tableQuery function and returns the entity-view generator object.

    :param syn:      A Synapse object: syn = synapseclient.login(username, password) - Must be logged into synapse
    :param view_id:  A Synapse ID of an entity-view (Note: Edit permission on its' files is required)
    :param clause:   A SQL clause to allow for sub-setting & row filtering in order to reduce the data-size
    :return:         An object of type synapse entity-view
    """

    if clause is None:
        query = "".join(['select * from ', view_id])
        view = syn.tableQuery(query)
    else:
        query = "".join(['select * from ', view_id, ' ', clause])
        view = syn.tableQuery(query)

    return view