BelongsToMany class

Inheritance

Constructors

BelongsToMany({required Model parent, required Model related, required String pivotTable, required String parentPivotKey, required String relatedPivotKey, String parentLocalKey = 'id', String relatedLocalKey = 'id', List<String> pivotFields = const []})

Properties

foreignKey String?
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
localKey String
getter/setter pairinherited
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
parentLocalKey String
final
parentPivotKey String
final
pivotFields List<String>
final
pivotTable String
final
finalinherited
relatedLocalKey String
final
relatedPivotKey String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

match(List<Map<String, dynamic>> parents, List<Map<String, dynamic>> rows, String relationName) List<Map<String, dynamic>>
override
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