* Define a new belongsTo relation. * @param name - The name of the belongsTo relation. * @param definition - The definition of the belongsTo relation.
(
name: string,
definition: Omit<BelongsToDefinition, 'name' | 'type' | 'targetsMany'>,
)
| 193 | * @param definition - The definition of the belongsTo relation. |
| 194 | */ |
| 195 | belongsTo( |
| 196 | name: string, |
| 197 | definition: Omit<BelongsToDefinition, 'name' | 'type' | 'targetsMany'>, |
| 198 | ): this { |
| 199 | const meta: BelongsToDefinition = { |
| 200 | ...definition, |
| 201 | name, |
| 202 | type: RelationType.belongsTo, |
| 203 | targetsMany: false, |
| 204 | }; |
| 205 | return this.addRelation(meta); |
| 206 | } |
| 207 | |
| 208 | /** |
| 209 | * Define a new hasOne relation. |
no test coverage detected