The getAssociation mixin applied to models with hasOne. An example of usage is as follows:
class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> { declare getRole: HasOneGetAssociationMixin<Role>;}User.hasOne(Role);
The associated model, or null if no model is associated. HasOne associations are always nullable because the foreign key is on the target model.
Model.hasOne
Optional
Generated using TypeDoc
The getAssociation mixin applied to models with hasOne. An example of usage is as follows:
Returns
The associated model, or null if no model is associated. HasOne associations are always nullable because the foreign key is on the target model.
See
Model.hasOne