当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Catalog_Model_Abstract::getEntityTypeId方法代码示例

本文整理汇总了PHP中Mage_Catalog_Model_Abstract::getEntityTypeId方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Catalog_Model_Abstract::getEntityTypeId方法的具体用法?PHP Mage_Catalog_Model_Abstract::getEntityTypeId怎么用?PHP Mage_Catalog_Model_Abstract::getEntityTypeId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Catalog_Model_Abstract的用法示例。


在下文中一共展示了Mage_Catalog_Model_Abstract::getEntityTypeId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: afterLoad

 /**
  * Assign group prices to product data
  *
  * @param Mage_Catalog_Model_Abstract $object
  * @return $this
  */
 public function afterLoad($object)
 {
     $data = $this->_getResource()->loadProfileData($object->getId(), $object->getEntityTypeId());
     $object->setData($this->getAttribute()->getName(), $data);
     $object->setOrigData($this->getAttribute()->getName(), $data);
     return $this;
 }
开发者ID:tormit,项目名称:Ho_Import,代码行数:13,代码来源:Profile.php

示例2: _updateAttributeForStore

 /**
  * Update attribute value for specific store
  *
  * @param Mage_Catalog_Model_Abstract $object
  * @param object $attribute
  * @param mixed $value
  * @param int $storeId
  * @return Mage_Catalog_Model_Resource_Abstract
  */
 protected function _updateAttributeForStore($object, $attribute, $value, $storeId)
 {
     $adapter = $this->_getWriteAdapter();
     $table = $attribute->getBackend()->getTable();
     $entityIdField = $attribute->getBackend()->getEntityIdField();
     $select = $adapter->select()->from($table, 'value_id')->where('entity_type_id = :entity_type_id')->where("{$entityIdField} = :entity_field_id")->where('store_id = :store_id')->where('attribute_id = :attribute_id');
     $bind = array('entity_type_id' => $object->getEntityTypeId(), 'entity_field_id' => $object->getId(), 'store_id' => $storeId, 'attribute_id' => $attribute->getId());
     $valueId = $adapter->fetchOne($select, $bind);
     /**
      * When value for store exist
      */
     if ($valueId) {
         $bind = array('value' => $this->_prepareValueForSave($value, $attribute));
         $where = array('value_id = ?' => (int) $valueId);
         $adapter->update($table, $bind, $where);
     } else {
         $bind = array($idField => (int) $object->getId(), 'entity_type_id' => (int) $object->getEntityTypeId(), 'attribute_id' => (int) $attribute->getId(), 'value' => $this->_prepareValueForSave($value, $attribute), 'store_id' => (int) $storeId);
         $adapter->insert($table, $bind);
     }
     return $this;
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:30,代码来源:Abstract.php

示例3: _updateAttributeForStore

 /**
  * Update attribute value for specific store
  *
  * @param   Mage_Catalog_Model_Abstract $object
  * @param   object $attribute
  * @param   mixed $value
  * @param   int $storeId
  * @return  Mage_Catalog_Model_Resource_Eav_Mysql4_Abstract
  */
 protected function _updateAttributeForStore($object, $attribute, $value, $storeId)
 {
     $entityIdField = $attribute->getBackend()->getEntityIdField();
     $select = $this->_getWriteAdapter()->select()->from($attribute->getBackend()->getTable(), 'value_id')->where('entity_type_id=?', $object->getEntityTypeId())->where("{$entityIdField}=?", $object->getId())->where('store_id=?', $storeId)->where('attribute_id=?', $attribute->getId());
     /**
      * When value for store exist
      */
     if ($valueId = $this->_getWriteAdapter()->fetchOne($select)) {
         $this->_getWriteAdapter()->update($attribute->getBackend()->getTable(), array('value' => $this->_prepareValueForSave($value, $attribute)), 'value_id=' . $valueId);
     } else {
         $this->_getWriteAdapter()->insert($attribute->getBackend()->getTable(), array($entityIdField => $object->getId(), 'entity_type_id' => $object->getEntityTypeId(), 'attribute_id' => $attribute->getId(), 'value' => $this->_prepareValueForSave($value, $attribute), 'store_id' => $storeId));
     }
     return $this;
 }
开发者ID:joebushi,项目名称:magento-mirror,代码行数:23,代码来源:Abstract.php


注:本文中的Mage_Catalog_Model_Abstract::getEntityTypeId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。