@@ -105,10 +105,19 @@ protected function _setDataValues($dataObject, array $data, $interfaceName)
105
105
$ setMethods = array_filter ($ dataObjectMethods , static function ($ e ) {
106
106
return 0 === strncmp ($ e , 'set ' , 3 );
107
107
});
108
- $ setMethods = array_flip ( array_map (static function ($ e ) {
108
+ $ setMethods = array_map (static function ($ e ) {
109
109
return SimpleDataObjectConverter::camelCaseToSnakeCase (substr ($ e , 3 ));
110
- }, $ setMethods ));
111
-
110
+ }, $ setMethods );
111
+ $ setMethods = array_merge (
112
+ $ setMethods ,
113
+ array_map (
114
+ function ($ e ) {
115
+ return str_replace ('is_ ' , '' , $ e );
116
+ },
117
+ $ setMethods
118
+ )
119
+ );
120
+ $ setMethods = array_flip ($ setMethods );
112
121
if ($ dataObject instanceof ExtensibleDataInterface
113
122
&& !empty ($ data [CustomAttributesDataInterface::CUSTOM_ATTRIBUTES ])
114
123
) {
@@ -140,7 +149,11 @@ protected function _setDataValues($dataObject, array $data, $interfaceName)
140
149
141
150
if (!is_array ($ value )) {
142
151
if ($ methodName !== 'setExtensionAttributes ' || $ value !== null ) {
143
- $ dataObject ->{'set ' . $ methodName }($ value );
152
+ if (method_exists ($ dataObject , 'set ' . $ methodName )) {
153
+ $ dataObject ->{'set ' . $ methodName }($ value );
154
+ } else {
155
+ $ dataObject ->{'setIs ' . $ methodName }($ value );
156
+ }
144
157
}
145
158
} else {
146
159
$ getterMethodName = 'get ' . $ methodName ;
@@ -149,8 +162,8 @@ protected function _setDataValues($dataObject, array $data, $interfaceName)
149
162
unset($ data [$ key ]);
150
163
}
151
164
152
- foreach ($ data as $ key => $ value ) {
153
- if ($ dataObject instanceof CustomAttributesDataInterface ) {
165
+ if ($ dataObject instanceof CustomAttributesDataInterface ) {
166
+ foreach ($ data as $ key => $ value ) {
154
167
$ dataObject ->setCustomAttribute ($ key , $ value );
155
168
}
156
169
}
0 commit comments