belongsToMany<Parent extends RelationalModel<Parent>, Child extends RelationalModel<Child>> function

Relation<Parent, Child> belongsToMany<Parent extends RelationalModel<Parent>, Child extends RelationalModel<Child>>(
  1. RelationalModel<Child> child,
  2. String pivotTable,
  3. String pivotForeignKey,
  4. String pivotRelatedKey, [
  5. RelationScope? scope,
])

Implementation

Relation<Parent, Child> belongsToMany<Parent extends RelationalModel<Parent>, Child extends RelationalModel<Child>>(
  RelationalModel<Child> child,
  String pivotTable,
  String pivotForeignKey,
  String pivotRelatedKey, [
  RelationScope? scope,
]) {
  return Relation(
    child: child,
    type: RelationType.belongsToMany,
    foreignKey: '',          // unused
    localKey: null,          // unused
    pivotTable: pivotTable,
    pivotForeignKey: pivotForeignKey,
    pivotRelatedKey: pivotRelatedKey,
    scope: scope,
  );
}