/** * {@inheritdoc} */ protected function handleProductAssociationCalls(array $associationCalls) { foreach ($associationCalls['remove'] as $removeCall) { try { $this->webservice->removeProductAssociation($removeCall); $this->productExportManager->updateProductAssociationExport($this->getJobInstance(), $removeCall['product']); } catch (RestCallException $e) { throw new InvalidItemException(sprintf('An error occured during a product association remove call. This may be due to a linked ' . 'product that doesn\'t exist on Prestashop side. Error message : %s', $e->getMessage()), $removeCall); } } foreach ($associationCalls['create'] as $createCall) { try { $this->webservice->createProductAssociation($createCall); $this->productExportManager->updateProductAssociationExport($this->getJobInstance(), $createCall['product']); } catch (RestCallException $e) { throw new InvalidItemException(sprintf('An error occured during a product association add call. This may be due to a linked ' . 'product that doesn\'t exist on Prestashop side. Error message : %s', $e->getMessage()), $createCall); } } }