getModel<T extends AtCollectionModel> static method

Future<T> getModel<T extends AtCollectionModel>({
  1. required String id,
  2. required String namespace,
  3. required String collectionName,
})

Returns an instance of a class extending AtCollectionModel for the given id, namespace and collectionName An instance of AtJsonCollectionModel is returned If a specific factory class for a given collection name is not registered Factory class for a collectionName can be registered using method AtCollectionModel.registerFactories(factories)

Throws Exception when an AtCollectionModel could not found for the given inputs

Implementation

static Future<T> getModel<T extends AtCollectionModel>(
    {required String id,
    required String namespace,
    required String collectionName}) async {
  _logger.finer(
      'get model for id:$id namespace:$namespace collectionName:$collectionName');
  AtCollectionModelFactoryManager.getInstance()
      .register(_jsonCollectionModelFactory);
  return _atCollectionQueryOperations.getModel(id, namespace, collectionName);
}