MorphPlaceholder class

Inheritance

Constructors

MorphPlaceholder()

Properties

autoIncrementPrimary bool
no setterinherited
dbService RelationalDatabaseAdapter
Universal DB service
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
loadedIncludes Map<String, RelationScope>
Track which relations were included and loaded last
getter/setter pairinherited
pivot Map<String, dynamic>?
getter/setter pairinherited
primaryKey String
no setterinherited
resolvedRelations Map<String, dynamic>
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
softDeletes bool
no setterinherited
table String
Table name this model belongs to (e.g. "rooms", "bots").
no setteroverride
timestamps bool
no setterinherited

Methods

all({dynamic include = const []}) Future<List<MorphPlaceholder>>
Find multiple records by a list of IDs.
inherited
associate(String relName, RelationalModel<RelationalModel> parent) → void
inherited
attach(String relName, RelationalModel<RelationalModel> child) → void
HAS ONE / HAS MANY: parent.attach('hosts', child), sets FK on child, requires save()
inherited
attachMany(String relName, List<RelationalModel<RelationalModel>> children) → void
inherited
attachPivot(String relName, RelationalModel<RelationalModel> related, {Map<String, dynamic>? pivot}) Future<void>
Attach with pivot table. Saved into db
inherited
delete({Map<String, dynamic>? where}) Future<int>
Delete this model safely through RelationalModel.
inherited
detachPivot(String relName, dynamic relatedId) Future<void>
Detach from pivot table by related model ID. Deleted from DB immediately.
inherited
find(dynamic pkValue, {dynamic include = const {}}) Future<MorphPlaceholder?>
Find a record by primary key (id).
inherited
findMany(List pkValues, {dynamic include = const []}) Future<List<MorphPlaceholder>>
Find multiple records by a list of IDs.
inherited
findOrFail(dynamic pkValue, {List<String> include = const []}) Future<MorphPlaceholder>
Find a record by primary key (id) or throw if not found.
inherited
firstWhere(String column, dynamic value) Future<MorphPlaceholder?>
Get the first record matching a condition.
inherited
fromJson(Map<String, dynamic> json) MorphPlaceholder
override
fromMap(Map<String, dynamic> map) MorphPlaceholder
inherited
getLoadedIncludePaths() List<String>
Get names of loaded includes
inherited
getLoadedIncludes() Map<String, RelationScope>
Get loaded includes
inherited
getRelation(String name) → dynamic
Get relation
inherited
getRelations() → dynamic
Get relations
inherited
hydrate(List<Map<String, dynamic>> rows) Hydrator<MorphPlaceholder>
Hydrate method. Hydrate either a single row or many (no async here).
inherited
hydrateMany(List<Map<String, dynamic>> rows) List<MorphPlaceholder>
Hydrate many rows into models (no query).
inherited
hydrateOne(Map<String, dynamic> row) MorphPlaceholder
Hydrate a single row into a model (no query).
inherited
loadRelations(List<MorphPlaceholder> items, {dynamic include}) Future<List<MorphPlaceholder>>
inherited
mergeIncludes(dynamic newIncludes, Map<String, RelationScope> existingIncludes) Map<String, RelationScope>
inherited
mergeRelationScopes(RelationScope newScope, RelationScope? oldScope) RelationScope
Merge relation scopes
inherited
normalizeIncludes(dynamic includesInput) Map<String, RelationScope>
Normalize inputs
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
query() Query<MorphPlaceholder>
inherited
refresh({dynamic include, bool append = true}) Future<MorphPlaceholder>
Refresh model
inherited
relations() Map<String, Relation<MorphPlaceholder, dynamic>>
Each model overrides this to declare relations
inherited
save({bool autoTimestamps = true, bool autoId = true}) Future<MorphPlaceholder?>
Save itself, auto-generates UUID if needed, returns fresh hydrated model.
inherited
serialize() Map<String, dynamic>
Serialize any model to Map (shortcut for toJson)
inherited
setAttribute(String column, dynamic value) → void
inherited
setLoadedIncludes(Map<String, RelationScope> includes) → void
Mark includes as loaded
inherited
setRelation(String name, dynamic value) → void
Set relation
inherited
toJson() Map<String, dynamic>
override
toMap() Map<String, dynamic>
inherited
toString() String
A string representation of this object.
inherited
update({String? where, List? params}) Future<int>
Update this model in the database.
inherited
updatePivot(String relName, dynamic relatedId, Map<String, dynamic> values) Future<int>
Update pivot data between this model and a related model. Updates DB immediately. Does NOT reload models.
inherited
where(String column, dynamic value) Future<List<MorphPlaceholder>>
Get all records matching a condition.
inherited

Operators

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