コード例 #1
0
ファイル: Attribute.php プロジェクト: jauderho/magento-mirror
 /**
  * Save Custom labels for Attribute name
  *
  * @param Mage_Eav_Model_Entity_Attribute_Abstract $attribute
  * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Type_Configurable_Attribute
  */
 public function saveLabel($attribute)
 {
     $select = $this->_getWriteAdapter()->select()->from($this->_labelTable, 'value_id')->where('product_super_attribute_id=?', $attribute->getId())->where('store_id=?', (int) $attribute->getStoreId());
     if ($valueId = $this->_getWriteAdapter()->fetchOne($select)) {
         $this->_getWriteAdapter()->update($this->_labelTable, array('value' => $attribute->getLabel()), $this->_getWriteAdapter()->quoteInto('value_id=?', $valueId));
     } else {
         $this->_getWriteAdapter()->insert($this->_labelTable, array('product_super_attribute_id' => $attribute->getId(), 'store_id' => (int) $attribute->getStoreId(), 'value' => $attribute->getLabel()));
     }
     return $this;
 }