@@ -105,10 +105,19 @@ protected function _setDataValues($dataObject, array $data, $interfaceName)
105105 $ setMethods = array_filter ($ dataObjectMethods , static function ($ e ) {
106106 return 0 === strncmp ($ e , 'set ' , 3 );
107107 });
108- $ setMethods = array_flip ( array_map (static function ($ e ) {
108+ $ setMethods = array_map (static function ($ e ) {
109109 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 );
112121 if ($ dataObject instanceof ExtensibleDataInterface
113122 && !empty ($ data [CustomAttributesDataInterface::CUSTOM_ATTRIBUTES ])
114123 ) {
@@ -140,7 +149,11 @@ protected function _setDataValues($dataObject, array $data, $interfaceName)
140149
141150 if (!is_array ($ value )) {
142151 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+ }
144157 }
145158 } else {
146159 $ getterMethodName = 'get ' . $ methodName ;
@@ -149,8 +162,8 @@ protected function _setDataValues($dataObject, array $data, $interfaceName)
149162 unset($ data [$ key ]);
150163 }
151164
152- foreach ($ data as $ key => $ value ) {
153- if ($ dataObject instanceof CustomAttributesDataInterface ) {
165+ if ($ dataObject instanceof CustomAttributesDataInterface ) {
166+ foreach ($ data as $ key => $ value ) {
154167 $ dataObject ->setCustomAttribute ($ key , $ value );
155168 }
156169 }
0 commit comments