MorphRelation class abstract

Inheritance
Implementers

Constructors

MorphRelation({required Model related, required Model parent, required String morphKey, required String morphType, String? pivotTable, String? relatedMorphKey, String localKey = 'id', String? type})

Properties

foreignKey String?
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
localKey String
getter/setter pairinherited
morphKey String
final
morphType String
final
parent Model
finalinherited
parentForeignKey String
The conventional foreign key pointing at the parent, used when the relation was declared without an explicit foreignKey.
no setterinherited
pivotTable String?
final
finalinherited
relatedMorphKey String?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String?
final

Methods

match(List<Map<String, dynamic>> models, List<Map<String, dynamic>> results, String relation) List<Map<String, dynamic>>
inherited
matchMany(List<Map<String, dynamic>> models, List<Map<String, dynamic>> results, String relation, String parentKey, String relatedKey) List<Map<String, dynamic>>
Match many related models to parents (for normal relations)
inherited
matchMorphMany(List<Map<String, dynamic>> models, List<Map<String, dynamic>> results, String relation, String parentKey, String relatedIdKey, String typeKey, String expectedType) List<Map<String, dynamic>>
Match many related morph models to parents. Only includes results where the morph type (at column typeKey) equals expectedType.
inherited
matchMorphOneOrMany(List<Map<String, dynamic>> models, List<Map<String, dynamic>> results, String relation, String parentKey, String relatedIdKey, String typeKey, String expectedType) List<Map<String, dynamic>>
Match one related morph model to parents (for hasOne polymorphic relation). Only includes results where typeKey equals expectedType and returns only the first matching result.
inherited
matchMorphToOne(List<Map<String, dynamic>> parents, List<Map<String, dynamic>> results, String relation, String morphKey, String relatedKey) List<Map<String, dynamic>>
inherited
matchOneOrMany(List<Map<String, dynamic>> models, List<Map<String, dynamic>> results, String relation, String parentKey, String relatedKey) List<Map<String, dynamic>>
inherited
matchToMany(List<Map<String, dynamic>> parents, List<Map<String, dynamic>> results, String relation, String parentLocalKey, String parentPivotKey, String relatedPivotKey, {List<String> pivotFields = const []}) List<Map<String, dynamic>>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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