'Get a copy of all the records that match the data passed in
this can be modified by the callback function'

def getRows(self, table, data, dbcallback, components):

    def add_component_to_query(self, table, query, details, components):
        '\n                                                                If    possible    add    the    component    to    the    query.    This    uses    the\n                                                                parameter    components    which    is    a    map    keyed    on    the    name    of    the\n                                                                html    control,    which    will    give    a    list    of    three    elements.\n                                                                The    name    of    the    related    table,    the    key    field    and    the    field    where\n                                                                the    data    will    be    added.\n\n                                                                For    example    see    CreatePerson\n                                                                "sub_person_details_marital_status":["pr_person_details",\n                                                                                                                                                                                                                    "person_id",\n                                                                                                                                                                                                                    "marital_status"\n                                                                                                                                                                                                                ]\n                                                                If    the    field    is    not    in    the    components    then    a    warning    is    written\n\n                                                                see    http://eden.sahanafoundation.org/ticket/1475\n                                                '
        if (details[0] in components):
            component = components[details[0]]
            ctable = current.s3db[component[0]]
            query = (query & (table.id == ctable[component[1]]))
            query = (query & (ctable[component[2]] == details[1]))
        else:
            self.reporter(('WARNING:    Unable    to    check    field    %s' % details[0]))
        return query
    current.db.commit()
    query = (table.deleted != True)
    for details in data:
        if (details[0][0:3] == 'sub'):
            query = add_component_to_query(self, table, query, details, components)
        else:
            query = (query & (table[details[0]] == details[1]))
    rows = current.db(query).select(orderby=(~ table.id))
    if (rows == None):
        rows = []
    if dbcallback:
        rows = dbcallback(table, data, rows)
    return rows
