Class OrganizerDB
java.lang.Object
com.example.slacks_lottoevent.database.OrganizerDB
OrganizerDB is a singleton class that manages the Firestore database for organizers.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Interface for listening to changes in the organizers collection. -
Method Summary
Modifier and TypeMethodDescriptionstatic OrganizerDB
Get the singleton instance of OrganizerDB.void
Set the listener for changes in the organizers collection.void
Start listening to Firestore updates for the organizers collection.void
Stop listening to Firestore updates.void
updateOrganizer
(String deviceId, ArrayList<String> eventIds) Update the organizer in the Firestore database.
-
Method Details
-
getInstance
Get the singleton instance of OrganizerDB.- Returns:
- The singleton instance of OrganizerDB.
-
startListening
public void startListening()Start listening to Firestore updates for the organizers collection. -
stopListening
public void stopListening()Stop listening to Firestore updates. -
setOrganizerChangeListener
Set the listener for changes in the organizers collection.- Parameters:
listener
- the listener for changes in the organizers collection
-
updateOrganizer
Update the organizer in the Firestore database.- Parameters:
deviceId
- the device ID of the organizereventIds
- the list of event IDs
-