mythix-orm 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/model.js +19 -3
- package/package.json +1 -1
package/lib/model.js
CHANGED
|
@@ -1071,15 +1071,31 @@ class Model {
|
|
|
1071
1071
|
_getFieldValue(fieldName, field) {
|
|
1072
1072
|
let value = this.getDataValue(fieldName);
|
|
1073
1073
|
|
|
1074
|
-
if (typeof field.get === 'function')
|
|
1075
|
-
return field.get.call(this, {
|
|
1074
|
+
if (typeof field.get === 'function') {
|
|
1075
|
+
return field.get.call(this, {
|
|
1076
|
+
model: this,
|
|
1077
|
+
set: this.setDataValue.bind(this, fieldName),
|
|
1078
|
+
get: this.getDataValue.bind(this, fieldName),
|
|
1079
|
+
value,
|
|
1080
|
+
field,
|
|
1081
|
+
fieldName,
|
|
1082
|
+
});
|
|
1083
|
+
}
|
|
1076
1084
|
|
|
1077
1085
|
return value;
|
|
1078
1086
|
}
|
|
1079
1087
|
|
|
1080
1088
|
_setFieldValue(fieldName, field, value) {
|
|
1081
1089
|
if (typeof field.set === 'function') {
|
|
1082
|
-
field.set.call(this, {
|
|
1090
|
+
field.set.call(this, {
|
|
1091
|
+
model: this,
|
|
1092
|
+
set: this.setDataValue.bind(this, fieldName),
|
|
1093
|
+
get: this.getDataValue.bind(this, fieldName),
|
|
1094
|
+
value,
|
|
1095
|
+
field,
|
|
1096
|
+
fieldName,
|
|
1097
|
+
});
|
|
1098
|
+
|
|
1083
1099
|
return;
|
|
1084
1100
|
}
|
|
1085
1101
|
|