Documentation / @blazetrails/activerecord / Associations
Class: Associations
Defined in: packages/activerecord/lib/associations.ts:93
Constructors
Constructor
new Associations():
Associations
Returns
Associations
Methods
belongsTo()
staticbelongsTo(this,name,scope?,options?):void
Defined in: packages/activerecord/lib/associations.ts:94
Parameters
| Parameter | Type | Default value |
|---|---|---|
this | typeof Base | undefined |
name | string | undefined |
scope | ((this, ...args) => any) | AssociationOptions | null | null |
options | AssociationOptions | {} |
Returns
void
hasAndBelongsToMany()
statichasAndBelongsToMany(this,name,scope?,options?,extension?):void
Defined in: packages/activerecord/lib/associations.ts:148
Parameters
| Parameter | Type | Default value |
|---|---|---|
this | typeof Base | undefined |
name | string | undefined |
scope | ((this, ...args) => any) | AssociationOptions & { joinTable?: string; } | null | null |
options | AssociationOptions & { joinTable?: string; } | {} |
extension? | (mod) => void | undefined |
Returns
void
hasMany()
statichasMany(this,name,scope?,options?,extension?):void
Defined in: packages/activerecord/lib/associations.ts:127
Parameters
| Parameter | Type | Default value |
|---|---|---|
this | typeof Base | undefined |
name | string | undefined |
scope | AssociationOptions | ((this, ...args) => any) | null | null |
options | AssociationOptions | {} |
extension? | (mod) => void | undefined |
Returns
void
hasOne()
statichasOne(this,name,scope?,options?):void
Defined in: packages/activerecord/lib/associations.ts:113
Parameters
| Parameter | Type | Default value |
|---|---|---|
this | typeof Base | undefined |
name | string | undefined |
scope | AssociationOptions | ((this, ...args) => any) | null | null |
options | AssociationOptions | {} |
Returns
void