/** * {@inheritdoc} */ public function getMapping() { $simpleMappingItems = $this->simpleMappingManager->getMapping($this->getIdentifier($this->rootIdentifier)); $mapping = new MappingCollection(); foreach ($simpleMappingItems as $simpleMappingItem) { $mapping->add(array('source' => $simpleMappingItem->getSource(), 'target' => $simpleMappingItem->getTarget(), 'deletable' => true)); } return $mapping; }
/** * {@inheritdoc} */ public function getMapping() { $prestashopAttributeMappings = $this->attributeMappingManager->getAllPrestashopAttribute($this->clientParameters->getPrestashopUrl()); $attributeCodeMapping = $this->attributeCodeMappingMerger->getMapping(); $mappingCollection = new MappingCollection(); foreach ($prestashopAttributeMappings as $prestashopAttributeMapping) { $pimAttributeCode = $prestashopAttributeMapping->getAttribute()->getCode(); $mappingCollection->add(['source' => $attributeCodeMapping->getTarget($pimAttributeCode), 'target' => $prestashopAttributeMapping->getPrestashopAttributeId(), 'deletable' => true]); } return $mappingCollection; }
/** * {@inheritdoc} */ public function getMapping() { $mapping = new MappingCollection(); if ($this->isValid()) { try { $attributes = $this->webserviceGuesser->getWebservice($this->clientParameters)->getAllAttributes(); } catch (RestCallException $e) { return $mapping; } foreach ($attributes as $attribute) { $mapping->add(['source' => $attribute['code'], 'target' => $attribute['attribute_id'], 'deletable' => true]); } } return $mapping; }
/** * {@inheritdoc} */ public function getMapping() { if (!$this->isValid()) { return new MappingCollection(); } else { try { $attributes = $this->webserviceGuesser->getWebservice($this->clientParameters)->getAllAttributes(); } catch (RestCallException $e) { return new MappingCollection(); } $mapping = new MappingCollection(); foreach (array_keys($attributes) as $attributeCode) { if (in_array($attributeCode, $this->mandatoryAttributes())) { $mapping->add(['source' => $attributeCode, 'target' => $attributeCode, 'deletable' => false]); } } return $mapping; } }