/** * {@inheritdoc} */ public function execute() { parent::beforeExecute(); $prestashopAttributes = $this->webservice->getAllAttributes(); foreach ($prestashopAttributes as $attribute) { $this->cleanAttribute($attribute, $prestashopAttributes); } }
/** * {@inheritdoc} */ public function execute() { parent::beforeExecute(); $prestashopOptions = $this->webservice->getAllAttributesOptions(); foreach ($prestashopOptions as $attributeCode => $options) { $attribute = $this->getAttribute($attributeCode); $this->cleanOptions($options, $attribute); } }
/** * {@inheritdoc} */ public function execute() { parent::beforeExecute(); $prestashopFamilies = $this->webservice->getAttributeSetList(); foreach ($prestashopFamilies as $name => $id) { try { $this->handleFamilyNotInPimAnymore($name, $id); } catch (RestCallException $e) { throw new InvalidItemException($e->getMessage(), [$name]); } } }
/** * {@inheritdoc} */ public function execute() { parent::beforeExecute(); $prestashopCategories = $this->webservice->getCategoriesStatus(); foreach ($prestashopCategories as $category) { if (!$this->categoryMappingManager->prestashopCategoryExists($category['category_id'], $this->getPrestashopUrl()) && !($category['level'] === '0' || $category['level'] === '1')) { try { $this->handleCategoryNotInPimAnymore($category); } catch (RestCallException $e) { throw new InvalidItemException($e->getMessage(), [json_encode($category)]); } } } }
/** * {@inheritdoc} */ public function execute() { parent::beforeExecute(); $prestashopProducts = $this->webservice->getProductsStatus(); $exportedProducts = $this->getExportedProductsSkus(); $pimProducts = $this->getPimProductsSkus(); foreach ($prestashopProducts as $product) { try { if (AbstractNormalizer::PRESTASHOP_SIMPLE_PRODUCT_KEY === $product['type'] || in_array($product['type'], $this->productTypesNotHandledByPim)) { if (!in_array($product['sku'], $pimProducts)) { $this->handleProductNotInPimAnymore($product); } elseif (!in_array($product['sku'], $exportedProducts)) { $this->handleProductNotCompleteAnymore($product); } } } catch (RestCallException $e) { throw new InvalidItemException($e->getMessage(), [json_encode($product)]); } } }