toMap method

Map<String, dynamic> toMap({
  1. bool forModelJson = false,
})

Implementation

Map<String, dynamic> toMap({bool forModelJson = false}) {
  final ret = <String, dynamic>{};
  if (forModelJson) {
    ret['_note1'] = notes[0];
    ret['_note2'] = notes[1];
    ret['_note3'] = notes[2];
  }
  ret['entities'] =
      entities.map((e) => e.toMap(forModelJson: forModelJson)).toList();
  ret['lastEntityId'] = lastEntityId.toString();
  ret['lastIndexId'] = lastIndexId.toString();
  ret['lastRelationId'] = lastRelationId.toString();
  ret['lastSequenceId'] = lastSequenceId.toString();
  ret['modelVersion'] = modelVersion;
  if (forModelJson) {
    ret['modelVersionParserMinimum'] = modelVersionParserMinimum;
    ret['retiredEntityUids'] = retiredEntityUids;
    ret['retiredIndexUids'] = retiredIndexUids;
    ret['retiredPropertyUids'] = retiredPropertyUids;
    ret['retiredRelationUids'] = retiredRelationUids;
    ret['version'] = version;
  }
  return ret;
}