You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Notice in the following Contact Model I have a custom setter for name field and whenver I need to set value to this field I would expect it to be done through my custom name setter function.
class Contact extends Model {
static get fields() {
return [
{ name: "name", dataSource: "name" },
];
}
set name(val) {
// performing some custom logic
this.set("name", val);
}
get name(val) {
return this.get("name");
}
}
I've following relation defined in EntityContact model class
class EntityContact extends Model {
static relations = {
contactRecord: {
foreignKey: "contactId",
foreignStore: "contactStore",
relatedCollectionName: "entityContacts",
}
}
// ... other fields definition not mentioned
}
The problem lies here when I try to set the nested field using the setter function of model expecting it that I would call my custom name setter function but it doesn't.
Forum post
Consider the following relation:
Notice in the following Contact Model I have a custom setter for name field and whenver I need to set value to this field I would expect it to be done through my custom name setter function.
I've following relation defined in EntityContact model class
The problem lies here when I try to set the nested field using the setter function of model expecting it that I would call my custom name setter function but it doesn't.
The text was updated successfully, but these errors were encountered: