Skip to content

DatabaseConnection API

hc09141 edited this page Nov 4, 2016 · 1 revision

Deals with connecting to the database to retrieve or update information relating to contacts and providing this information to the UI.

DatabaseConnection.getContactDetails(id, ab)

Gets a contact from the database by id and provides details to the UI

Param Type Description
id Integer The id of the contact to retrieve
ab AddressBook The addressbook UI component

DatabaseConnection.updateContact(contact, ab)

Updates a contact in the database with changed information and updates the UI

Param Type Description
contact Contact The contact to update
ab AddressBook The addressbook UI component

DatabaseConnection.loadInContacts(ab)

Loads in the name, id and photo of all contacts in the database and provides this to the UI

Param Type Description
ab AddressBook The addressbook UI component

DatabaseConnection.export(selectedIds)

Exports contacts with the given ids

Param Type Description
selectedIds Array.<Integer> The ids of the contacts to be exported

DatabaseConnection.deleteContact(selectedIds, ab)

Deletes a contact from the database and the UI

Param Type Description
selectedIds Array.<Integer> The ids of the contacts to be exported
ab AddressBook The addressbook UI component