@@ -1000,10 +1000,12 @@ public function setParameters(array $params)
1000
1000
*/
1001
1001
public function deleteProductsForReplacement ()
1002
1002
{
1003
- $ this ->setParameters (array_merge (
1004
- $ this ->getParameters (),
1005
- ['behavior ' => Import::BEHAVIOR_DELETE ]
1006
- ));
1003
+ $ this ->setParameters (
1004
+ array_merge (
1005
+ $ this ->getParameters (),
1006
+ ['behavior ' => Import::BEHAVIOR_DELETE ]
1007
+ )
1008
+ );
1007
1009
$ this ->_deleteProducts ();
1008
1010
1009
1011
return $ this ;
@@ -1092,10 +1094,12 @@ protected function _replaceProducts()
1092
1094
$ this ->deleteProductsForReplacement ();
1093
1095
$ this ->_oldSku = $ this ->skuProcessor ->reloadOldSkus ()->getOldSkus ();
1094
1096
$ this ->_validatedRows = null ;
1095
- $ this ->setParameters (array_merge (
1096
- $ this ->getParameters (),
1097
- ['behavior ' => Import::BEHAVIOR_APPEND ]
1098
- ));
1097
+ $ this ->setParameters (
1098
+ array_merge (
1099
+ $ this ->getParameters (),
1100
+ ['behavior ' => Import::BEHAVIOR_APPEND ]
1101
+ )
1102
+ );
1099
1103
$ this ->_saveProductsData ();
1100
1104
1101
1105
return $ this ;
@@ -2626,9 +2630,12 @@ public function parseMultiselectValues($values, $delimiter = self::PSEUDO_MULTI_
2626
2630
return explode ($ delimiter , $ values );
2627
2631
}
2628
2632
if (preg_match_all ('~"((?:[^"]|"")*)"~ ' , $ values , $ matches )) {
2629
- return $ values = array_map (function ($ value ) {
2630
- return str_replace ('"" ' , '" ' , $ value );
2631
- }, $ matches [1 ]);
2633
+ return $ values = array_map (
2634
+ function ($ value ) {
2635
+ return str_replace ('"" ' , '" ' , $ value );
2636
+ },
2637
+ $ matches [1 ]
2638
+ );
2632
2639
}
2633
2640
return [$ values ];
2634
2641
}
@@ -3053,20 +3060,27 @@ private function processLinkBunches(
3053
3060
$ productId = $ this ->skuProcessor ->getNewSku ($ sku )[$ this ->getProductEntityLinkField ()];
3054
3061
$ productIds [] = $ productId ;
3055
3062
$ productLinkKeys = $ this ->fetchProductLinks ($ resource , $ productId );
3056
- $ linkNameToId = array_filter ($ this ->_linkNameToId , function ($ linkName ) use ($ rowData ) {
3057
- return isset ($ rowData [$ linkName . 'sku ' ]);
3058
- }, ARRAY_FILTER_USE_KEY );
3063
+ $ linkNameToId = array_filter (
3064
+ $ this ->_linkNameToId ,
3065
+ function ($ linkName ) use ($ rowData ) {
3066
+ return isset ($ rowData [$ linkName . 'sku ' ]);
3067
+ },
3068
+ ARRAY_FILTER_USE_KEY
3069
+ );
3059
3070
foreach ($ linkNameToId as $ linkName => $ linkId ) {
3060
3071
$ linkSkus = explode ($ this ->getMultipleValueSeparator (), $ rowData [$ linkName . 'sku ' ]);
3061
3072
$ linkPositions = !empty ($ rowData [$ linkName . 'position ' ])
3062
3073
? explode ($ this ->getMultipleValueSeparator (), $ rowData [$ linkName . 'position ' ])
3063
3074
: [];
3064
3075
3065
- $ linkSkus = array_filter ($ linkSkus , function ($ linkedSku ) use ($ sku ) {
3066
- $ linkedSku = trim ($ linkedSku );
3067
- return ($ this ->skuProcessor ->getNewSku ($ linkedSku ) !== null || $ this ->isSkuExist ($ linkedSku ))
3068
- && strcasecmp ($ linkedSku , $ sku ) !== 0 ;
3069
- });
3076
+ $ linkSkus = array_filter (
3077
+ $ linkSkus ,
3078
+ function ($ linkedSku ) use ($ sku ) {
3079
+ $ linkedSku = trim ($ linkedSku );
3080
+ return ($ this ->skuProcessor ->getNewSku ($ linkedSku ) !== null || $ this ->isSkuExist ($ linkedSku ))
3081
+ && strcasecmp ($ linkedSku , $ sku ) !== 0 ;
3082
+ }
3083
+ );
3070
3084
foreach ($ linkSkus as $ linkedKey => $ linkedSku ) {
3071
3085
$ linkedId = $ this ->getProductLinkedId ($ linkedSku );
3072
3086
if ($ linkedId == null ) {
0 commit comments