ModelInspector<M> class abstract

an Inspector to spy and operate on model objects

Constructors

ModelInspector()

Properties

allOrmMetaClasses List<OrmMetaClass>
all known classes
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getClassName(M model) String
return the class name of model
getDirtyFields(M model) Map<String, dynamic>
return modified fields of model as a Map
getFieldValue(M model, String fieldName) → dynamic
return the value of model.fieldName
idFields(String className) List<OrmMetaField>?
return id fields of className
isModelType(String type) bool
check whether a type is a model name.
loadModel(M model, Map<String, dynamic> m, {dynamic errorOnNonExistField = false}) → void
load model fields with a Map m
markDeleted(M model, bool deleted) → void
mark model as deleted, to support soft-delete
markLoaded(M model) → void
mark model has been loaded from DB.
meta(String className) OrmMetaClass?
return class meta info for className
newInstance(String className, {bool attachDb = false, dynamic id, required BaseModelQuery<Model, dynamic> topQuery}) → M
create a new instance of specified className newInstance() might return an instance cached in top query.
newQuery(Database db, String className) BaseModelQuery<Model, dynamic>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setFieldValue(M model, String fieldName, dynamic value) → void
set the value of model.fieldName as value
softDeleteField(String className) List<OrmMetaField>?
return soft-delete field of className
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited