belongsTo<Parent extends RelationalModel<Parent> , Child extends RelationalModel<Child> > function
Relation<Parent, Child>
belongsTo<Parent extends RelationalModel<Parent> , Child extends RelationalModel<Child> >(
- RelationalModel<
Child> child, - String foreignKey, [
- String? ownerKey,
- RelationScope? scope,
Implementation
Relation<Parent, Child> belongsTo<Parent extends RelationalModel<Parent>,Child extends RelationalModel<Child>>(
RelationalModel<Child> child,
String foreignKey,
[
String? ownerKey,
RelationScope? scope,
]
) {
return Relation(
child: child,
type: RelationType.belongsTo,
foreignKey: foreignKey,
localKey: ownerKey, // null -> remote PK
scope: scope,
);
}