Class EventRepository

java.lang.Object
com.example.skeddly.business.database.repository.GenericRepository<Event>
com.example.skeddly.business.database.repository.EventRepository

public class EventRepository extends GenericRepository<Event>
A class to handle retrieving events from Firestore.
  • Field Details

  • 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

      public com.google.android.gms.tasks.Task<Void> updateEvent(Event event)
    • getCollectionPath

      protected com.google.firebase.firestore.CollectionReference getCollectionPath()
      Description copied from class: GenericRepository
      This method retrieves the reference to the collection of documents it handles
      Specified by:
      getCollectionPath in class GenericRepository<Event>
      Returns:
      A CollectionReference to the collection of documents it handles.
    • getQuery

      protected com.google.firebase.firestore.Query getQuery()
      Description copied from class: GenericRepository
      This 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:
      getQuery in class GenericRepository<Event>
      Returns:
      A query that can retrieve multiple documents.