setToDBByMid method

Future<void> setToDBByMid(
  1. String mid, {
  2. bool dontRealTime = false,
})

Implementation

Future<void> setToDBByMid(String mid, {bool dontRealTime = false}) async {
  try {
    //print('setToDBByMid()');
    //await HycopFactory.dataBase!.setData(collectionId, model.mid, model.toMap());
    AbsExModel? model = getModel(mid);

    if (model != null) {
      await HycopFactory.dataBase!.setModel(collectionId, model, dontRealTime: dontRealTime);
    } else {
      logger.finest('model not found($collectionId, $mid) in this manager');
    }
  } catch (e) {
    logger.severe('databaseError', e);
    throw HycopException(message: 'databaseError', exception: e as Exception);
  }
}