Created
August 10, 2011 20:57
-
-
Save timbroder/1138243 to your computer and use it in GitHub Desktop.
_matchAttribute
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function _matchAttribute(Varien_Object $attribute, $item) | |
{ | |
$code = $attribute->getAttributeCode(); | |
$value = $item->getData($code); | |
Mage::log("Mapping Price code/value ".$code."/".$value, null, "migration.log"); | |
Mage::log($item, null, "migration.log"); | |
if ($code == 'entity_type_id') { | |
$value = $attribute->getEntityTypeId(); | |
} elseif ($code == 'attribute_set_id') { | |
if (!$value = $attribute->getDefaultAttributeSetId()) { | |
$value = $attribute->getEntityType()->getDefaultAttributeSetId(); | |
$attribute->setDefaultAttributeSetId($value); | |
} | |
} else if ($this->isValueEmpty($value, $attribute)){ | |
$this->_matchAttributeType($attribute, $value); | |
} | |
$item->setData($code, $value); | |
Mage::log("Mapping Price code/value (after)", null, "migration.log"); | |
Mage::log($item, null, "migration.log"); | |
return $this; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment