hasOne
Defining
// User.cfc
component extends="quick.models.BaseEntity" {
function profile() {
return hasOne( "UserProfile" );
}
}return hasOne("UserProfile", "FK_userID");return belongsTo("UserProfile", "FK_userID", "profile_id");// UserProfile.cfc
component extends="quick.models.BaseEntity" {
function user() {
return belongsTo( "User" );
}
}Last updated
Was this helpful?