withParent<R extends FirestoreEntity<R>> method

T withParent<R extends FirestoreEntity<R>>(
  1. R parent
)

Sets the parent collection of this document. This is required for subcollections.

Implementation

T withParent<R extends FirestoreEntity<R>>(R parent) {
  assert(DogFirestoreEngine.instance.checkSubcollection<R, T>());
  _injectedPath =
      "${parent.selfDocument.path}/${DogFirestoreEngine.instance.collectionName<T>()}";
  return this as T;
}