/** * Create Diff Data between incoming Attribute and existing Attribute Data * * @param Mage_Catalog_Model_Entity_Attribute $attribute Attribute to update * @param Aoe_AttributeConfigurator_Model_Config_Attribute $attributeConfig Attribute config * @return array */ protected function _getAttributeDiff($attribute, $attributeConfig) { $incomingData = $attributeConfig->getSettingsAsArray(); $existingData = $attribute->getData(); $diff = []; foreach ($incomingData as $key => $value) { /** * Only add this to the diff if key exists in Attribute Config (limiting incoming to valid settings) * and Incoming is different from existing setting * and Incoming Value is not empty (empty values are being ignored then */ if (array_key_exists(trim($key), $existingData) && $existingData[trim($key)] != $value && !empty($value)) { $diff[] = $key; } } return $diff; }