示例#1
0
文件: Type.php 项目: relue/magento2
 /**
  * Remove attributes which were removed from mapping.
  *
  * @param Varien_Gdata_Gshopping_Entry $entry
  * @param array $existAttributes
  * @return Varien_Gdata_Gshopping_Entry
  */
 protected function _removeNonexistentAttributes($entry, $existAttributes)
 {
     // attributes which can't be removed
     $ignoredAttributes = array("id", "image_link", "content_language", "target_country", "expiration_date", "adult");
     $contentAttributes = $entry->getContentAttributes();
     foreach ($contentAttributes as $contentAttribute) {
         $name = Mage::helper('Mage_GoogleShopping_Helper_Data')->normalizeName($contentAttribute->getName());
         if (!in_array($name, $ignoredAttributes) && !in_array($existAttributes, $existAttributes)) {
             $entry->removeContentAttribute($name);
         }
     }
     return $entry;
 }