protected function productImportAccessories($offset, $limit, &$crossStepsVariables)
 {
     if ($crossStepsVariables === false || !array_key_exists('accessories', $crossStepsVariables)) {
         return 0;
     }
     $accessories = $crossStepsVariables['accessories'];
     if ($offset == 0) {
         //             AdminImportController::setLocale();
         Module::setBatchMode(true);
     }
     $line_count = 0;
     $i = 0;
     foreach ($accessories as $product_id => $links) {
         // skip elements until reaches offset
         if ($i < $offset) {
             $i++;
             continue;
         }
         if (count($links) > 0) {
             // We delete and relink only if there is accessories to link...
             // Bulk jobs: for performances, we need to do a minimum amount of SQL queries. No product inflation.
             $unique_ids = Product::getExistingIdsFromIdsOrRefs($links);
             Db::getInstance()->delete('accessory', 'id_product_1 = ' . (int) $product_id);
             Product::changeAccessoriesForProduct($unique_ids, $product_id);
         }
         $line_count++;
         // Empty value to reduce array weight (that goes through HTTP requests each time) but do not unset array entry!
         $accessories[$product_id] = 0;
         // In JSON, 0 is lighter than null or false
         // stop when limit reached
         if ($line_count >= $limit) {
             break;
         }
     }
     if ($line_count < $limit) {
         // last pass only
         Module::processDeferedFuncCall();
         Module::processDeferedClearCache();
     }
     $crossStepsVariables['accessories'] = $accessories;
     return $line_count;
 }