collectReferences method

  1. @override
Future<List<ModelReference>> collectReferences({
  1. String? appId,
})
override

Implementation

@override
Future<List<ModelReference>> collectReferences({String? appId}) async {
  List<ModelReference> referencesCollector = [];
  var products = await productRepository(appId: appId)!.valuesListWithDetails(
      eliudQuery: EliudQuery(theConditions: [
    EliudQueryCondition('shopId', isEqualTo: documentID),
  ]));
  referencesCollector.addAll(products.map((product) =>
      ModelReference(ProductModel.packageName, ProductModel.id, product!)));
  if (conditions != null) {
    referencesCollector
        .addAll(await conditions!.collectReferences(appId: appId));
  }
  return referencesCollector;
}