Relation class abstract

Implementers

Constructors

Relation({required Model related, required Model parent, String? foreignKey, String localKey = 'id'})

Properties

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

Methods

match(List<Map<String, dynamic>> models, List<Map<String, dynamic>> results, String relation) List<Map<String, dynamic>>
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)
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.
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.
matchMorphToOne(List<Map<String, dynamic>> parents, List<Map<String, dynamic>> results, String relation, String morphKey, String relatedKey) List<Map<String, dynamic>>
matchOneOrMany(List<Map<String, dynamic>> models, List<Map<String, dynamic>> results, String relation, String parentKey, String relatedKey) List<Map<String, dynamic>>
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>>
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