Class EventRepository
java.lang.Object
com.example.skeddly.business.database.repository.GenericRepository<Event>
com.example.skeddly.business.database.repository.EventRepository
A class to handle retrieving events from Firestore.
-
Field Summary
FieldsFields inherited from class com.example.skeddly.business.database.repository.GenericRepository
clazz -
Constructor Summary
ConstructorsConstructorDescriptionEventRepository(com.google.firebase.firestore.FirebaseFirestore firestore) Creates a new event repository that is not associated with any particular organizer.EventRepository(com.google.firebase.firestore.FirebaseFirestore firestore, String organizerId) Creates a new event repository associated with a given organizer id. -
Method Summary
Modifier and TypeMethodDescriptionprotected com.google.firebase.firestore.CollectionReferenceThis method retrieves the reference to the collection of documents it handlesprotected com.google.firebase.firestore.QuerygetQuery()This method retrieves a query for getting all the documents handled by this repository.com.google.android.gms.tasks.Task<Void> updateEvent(Event event) Methods inherited from class com.example.skeddly.business.database.repository.GenericRepository
count, delete, get, getAll, getAllByQuery, listen, listenAll, set
-
Field Details
-
COLLECTION_PATH
- See Also:
-
organizerId
-
-
Constructor Details
-
EventRepository
public EventRepository(com.google.firebase.firestore.FirebaseFirestore firestore, String organizerId) Creates a new event repository associated with a given organizer id.- Parameters:
firestore- The FirebaseFirestore instance to use.
-
EventRepository
public EventRepository(com.google.firebase.firestore.FirebaseFirestore firestore) Creates a new event repository that is not associated with any particular organizer.- Parameters:
firestore- The FirebaseFirestore instance to use.
-
-
Method Details
-
updateEvent
-
getCollectionPath
protected com.google.firebase.firestore.CollectionReference getCollectionPath()Description copied from class:GenericRepositoryThis method retrieves the reference to the collection of documents it handles- Specified by:
getCollectionPathin classGenericRepository<Event>- Returns:
- A CollectionReference to the collection of documents it handles.
-
getQuery
protected com.google.firebase.firestore.Query getQuery()Description copied from class:GenericRepositoryThis method retrieves a query for getting all the documents handled by this repository. This is commonly overridden in repositories that filter out documents by fields.- Overrides:
getQueryin classGenericRepository<Event>- Returns:
- A query that can retrieve multiple documents.
-