$OrmMigrationRecord class

Generated tracked model class for OrmMigrationRecord.

This class extends the user-defined OrmMigrationRecord model and adds attribute tracking, change detection, and relationship management. Instances of this class are returned by queries and repositories.

Do not instantiate this class directly. Use queries, repositories, or model factories to create tracked model instances.

Inheritance
Available extensions

Constructors

$OrmMigrationRecord({required String id, required String checksum, required DateTime appliedAt, required int batch})
$OrmMigrationRecord.fromModel(OrmMigrationRecord model)
Creates a tracked model instance from a user-defined model instance.
factory

Properties

appliedAt DateTime
getter/setter pairoverride-getter
attributes Map<String, Object?>
Snapshot of the current attribute map.
no setterinherited
batch int
getter/setter pairoverride-getter
checksum String
getter/setter pairoverride-getter
connection → DriverAdapter?
The driver/connection associated with this model, if any.
no setterinherited
connectionResolver → ConnectionResolver?
The resolver attached to this model, when present.
no setterinherited
definition → ModelDefinition<OrmMigrationRecord>?
Typed accessor to the attached ModelDefinition, when available. Returns null for untracked models (they don't have attached definitions).
no setterinherited
exists bool
Whether this model has been persisted (loaded or saved).
no setterinherited
hasConnection bool
Whether a resolver/connection has been attached.
no setterinherited
hasDefinition bool
Whether a ModelDefinition has been attached to this instance. Always false for untracked models.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
id String
getter/setter pairoverride-getter
loadedRelationNames Set<String>
Returns names of all loaded relations.
no setterinherited
loadedRelations Map<String, dynamic>
Returns a snapshot of all currently loaded relations.
no setterinherited
modelDefinition → ModelDefinition<OrmEntity>?
Definition metadata attached to this model, when available.
no setterinherited
relations Map<String, dynamic>
Shorthand alias for loadedRelations.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

asMap({ValueCodecRegistry? registry}) Map<String, Object?>
Alias for toRecord for ergonomics when bridging to JSON/Maps.
inherited
associate(String relationName, Model<Model> parent) Future<OrmMigrationRecord>
Associates a belongsTo parent model and updates the foreign key.
inherited
attach(String relationName, List ids, {Map<String, dynamic>? pivotData}) Future<OrmMigrationRecord>
Attaches related models in a manyToMany relationship.
inherited
attachConnection(DriverAdapter driver) → void
Legacy helper for manually attaching a driver outside a resolver.
inherited
attachConnectionResolver(ConnectionResolver resolver) → void
Assigns the resolver responsible for this model instance.
inherited
attachModelDefinition(ModelDefinition<OrmEntity> definition) → void
Associates the generated model definition with this instance.
inherited
attachSoftDeleteColumn(String column) → void
Stores the effective soft delete column for this instance.
inherited
clearJsonAttributeUpdates() → void
Clears any pending JSON attribute updates without applying them.
inherited
clearQueuedJsonMutations() → void
Clears any queued JSON mutations without persisting them.
inherited
clearRelations() → void
Clears all cached relations.
inherited
copyWith({String? id, String? checksum, DateTime? appliedAt, int? batch}) $OrmMigrationRecord
delete({bool force = false}) Future<void>
Deletes the record. Soft-deletes when supported unless force is true.
inherited
describeMutation(MutationPlan plan) → StatementPreview
Returns the statement preview for a write plan.
inherited
describeQuery(QueryPlan plan) → StatementPreview
Returns the statement preview for a read plan.
inherited
detach(String relationName, [List? ids]) Future<OrmMigrationRecord>
Detaches related models in a manyToMany relationship.
inherited
dissociate(String relationName) Future<OrmMigrationRecord>
Dissociates a belongsTo parent model and clears the foreign key.
inherited
expectDefinition() → ModelDefinition<OrmMigrationRecord>
Ensures the definition metadata is available, throwing when missing.
inherited
fill(Map<String, Object?> attributes, {bool strict = false, ValueCodecRegistry? registry}) → Model<OrmMigrationRecord>
Mass assigns attributes, honoring fillable/guarded metadata.
inherited
fillAttributes(Map<String, Object?> payload, {bool strict = true, ValueCodecRegistry? registry}) Map<String, Object?>
Fills attributes from payload, respecting fillable/guarded metadata.
inherited
fillIfAbsent(Map<String, Object?> attributes, {bool strict = false, ValueCodecRegistry? registry}) → Model<OrmMigrationRecord>
Mass assigns only values that are currently absent.
inherited
forceDelete() Future<void>
Hard-deletes the record, bypassing soft-delete flows entirely.
inherited
forceFill(Map<String, Object?> attributes, {ValueCodecRegistry? registry}) → Model<OrmMigrationRecord>
Temporarily disables mass-assignment protection while callback runs.
inherited
fresh({bool withTrashed = false, Iterable<String>? withRelations}) Future<OrmMigrationRecord>
Returns a fresh instance of this model from the database.
inherited
getAttribute<T>(String column) → T?
Reads an attribute by column name.
inherited
getAttributes() Map<String, Object?>
Convenience method to get all attributes as a map.
inherited
getDirty() Map<String, Object?>
Gets only the attributes that have been modified.
inherited
getOriginal([String? attribute]) Object?
Gets the original value(s) before modifications.
inherited
getRelation<T>(String name) → T?
Retrieves a cached relation value typed as T.
inherited
getRelationList<T>(String name) List<T>
Retrieves a list relation typed as T.
inherited
getSoftDeleteColumn() String?
Returns the soft delete column name if the model supports it.
inherited
hasAttribute(String column) bool
Checks if an attribute exists in the attribute map.
inherited
isClean([Object? attributes]) bool
Checks if attributes have NOT been modified since the last sync.
inherited
isDifferentFrom(Model<Model>? other) bool
Determine if two models are different.
inherited
isDirty([Object? attributes]) bool
Checks if any attributes have been modified since the last sync.
inherited
isSameAs(Model<Model>? other) bool
Determine if two models represent the same database record.
inherited
jsonPatch(String column, Map<String, Object?> delta) → void
Queues a JSON patch merge for column using the provided delta map.
inherited
jsonSet(String selector, Object? value) → void
Queues a JSON update using Laravel-style selector syntax (column->path). Call save to persist the change.
inherited
jsonSetPath(String column, String path, Object? value) → void
Queues a JSON update by explicitly providing path relative to column.
inherited
load(String relation, [PredicateCallback<OrmEntity>? constraint]) Future<OrmMigrationRecord>
Lazily loads a relation on this model instance.
inherited
loadAvg(String relation, String column, {String? alias, PredicateCallback<OrmEntity>? constraint}) Future<OrmMigrationRecord>
Lazily loads the average of a column in a relation.
inherited
loadCount(String relation, {String? alias, PredicateCallback<OrmEntity>? constraint}) Future<OrmMigrationRecord>
Lazily loads the count of a relation.
inherited
loadExists(String relation, {String? alias, PredicateCallback<OrmEntity>? constraint}) Future<OrmMigrationRecord>
Lazily loads the existence of a relation.
inherited
loadMany(Map<String, PredicateCallback<OrmEntity>?> relations) Future<OrmMigrationRecord>
Lazily loads multiple relations with optional constraints.
inherited
loadMax(String relation, String column, {String? alias, PredicateCallback<OrmEntity>? constraint}) Future<OrmMigrationRecord>
Lazily loads the maximum value of a column in a relation.
inherited
loadMin(String relation, String column, {String? alias, PredicateCallback<OrmEntity>? constraint}) Future<OrmMigrationRecord>
Lazily loads the minimum value of a column in a relation.
inherited
loadMissing(Iterable<String> relations) Future<OrmMigrationRecord>
Lazily loads multiple relations that haven't been loaded yet.
inherited
loadSum(String relation, String column, {String? alias, PredicateCallback<OrmEntity>? constraint}) Future<OrmMigrationRecord>
Lazily loads the sum of a column in a relation.
inherited
markAsExisting() → void
Marks this model as existing in the database.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refresh({bool withTrashed = false, Iterable<String>? withRelations}) Future<OrmMigrationRecord>
Reloads the latest row from the database, optionally including trashed.
inherited
relationLoaded(String name) bool
Checks if a relation has been loaded.
inherited
replaceAttributes(Map<String, Object?> values) → void
Replaces the entire attribute map.
inherited
replicate({List<String>? except}) OrmMigrationRecord
Clone the model into a new, non-existing instance.
inherited
restore() Future<void>
Restores a soft-deleted record.
inherited
runMutation(MutationPlan plan) Future<MutationResult>
Runs a write plan through the attached resolver.
inherited
runSelect(QueryPlan plan) Future<List<Map<String, Object?>>>
Runs a read plan through the attached resolver.
inherited
save({bool returning = true}) Future<OrmMigrationRecord>
Persists the model using the active resolver and returns the stored copy.
inherited
serializableAttributes({bool includeHidden = false, ValueCodecRegistry? registry}) Map<String, Object?>
Serializes the attribute map, applying casts and filtering hidden fields.
inherited
setAttribute(String column, Object? value) → void
Upserts an attribute value.
inherited
setAttributes(Map<String, Object?> attributes) → void
Convenience method to fill attributes from a map, respecting fillable/guarded rules.
inherited
setJsonAttributePatch(String column, Map<String, Object?> delta) → void
Queues a JSON patch merge for column with the provided delta map.
inherited
setJsonAttributeValue(String columnOrSelector, Object? value, {String? pathOverride, bool patch = false}) → void
Queues a JSON update for columnOrSelector.
inherited
setRelation(String name, dynamic value) → void
Sets a relation value and marks it as loaded.
inherited
setRelations(Map<String, dynamic> relations) → void
Bulk sets multiple relations at once.
inherited
sync(String relationName, List ids, {Map<String, dynamic>? pivotData}) Future<OrmMigrationRecord>
Syncs a manyToMany relationship to match the given IDs exactly.
inherited
syncOriginal() → void
Syncs the current attributes as the "original" state for change tracking.
inherited
syncRelationsFromQueryRow(Map<String, dynamic> rowRelations) → void
Syncs relations from a QueryRow into this model's cache.
inherited
takeJsonAttributeUpdates() List<JsonAttributeUpdate>
Returns and clears any pending JSON attribute updates.
inherited
toArray({ValueCodecRegistry? registry, bool includeHidden = false}) Map<String, Object?>
Converts the model into a metadata-aware map, honoring hidden/visible lists.
inherited
toJson({ValueCodecRegistry? registry, bool includeHidden = false}) String
Converts the model instance into JSON, applying the attribute metadata.
inherited
toRecord({ValueCodecRegistry? registry}) Map<String, Object?>
Serializes the model into a column map via its codec/definition.
inherited
toString() String
A string representation of this object.
inherited
toTracked() $OrmMigrationRecord

Available on OrmMigrationRecord, provided by the OrmMigrationRecordOrmExtension extension

Converts this immutable model to a tracked ORM-managed model. The tracked model supports attribute tracking, change detection, and persistence operations like save() and touch().
unsetRelation(String name) → void
Removes a relation from the cache and marks it as not loaded.
inherited
wasChanged(String attribute) bool
Checks if a specific attribute was modified.
inherited

Operators

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