本文整理汇总了PHP中Mage_Eav_Model_Entity_Attribute_Abstract::isScopeStore方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Eav_Model_Entity_Attribute_Abstract::isScopeStore方法的具体用法?PHP Mage_Eav_Model_Entity_Attribute_Abstract::isScopeStore怎么用?PHP Mage_Eav_Model_Entity_Attribute_Abstract::isScopeStore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Eav_Model_Entity_Attribute_Abstract
的用法示例。
在下文中一共展示了Mage_Eav_Model_Entity_Attribute_Abstract::isScopeStore方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _updateAttribute
/**
* Update entity attribute value
*
* @param Varien_Object $object
* @param Mage_Eav_Model_Entity_Attribute_Abstract $attribute
* @param mixed $valueId
* @param mixed $value
* @return Mage_Eav_Model_Entity_Abstract
*/
protected function _updateAttribute($object, $attribute, $valueId, $value)
{
/**
* If we work in single store mode all values should be saved just
* for default store id
* In this case we clear all not default values
*/
if (AO::app()->isSingleStoreMode()) {
$this->_getWriteAdapter()->delete($attribute->getBackend()->getTable(), $this->_getWriteAdapter()->quoteInto('attribute_id=?', $attribute->getId()) . $this->_getWriteAdapter()->quoteInto(' AND entity_id=?', $object->getId()) . $this->_getWriteAdapter()->quoteInto(' AND store_id!=?', Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID));
}
/**
* Update attribute value for store
*/
if ($attribute->isScopeStore()) {
$this->_updateAttributeForStore($object, $attribute, $value, $object->getStoreId());
} elseif ($attribute->isScopeWebsite()) {
if ($object->getStoreId() == 0) {
$this->_updateAttributeForStore($object, $attribute, $value, $object->getStoreId());
} else {
if (is_array($object->getWebsiteStoreIds())) {
foreach ($object->getWebsiteStoreIds() as $storeId) {
$this->_updateAttributeForStore($object, $attribute, $value, $storeId);
}
}
}
} else {
$this->_getWriteAdapter()->update($attribute->getBackend()->getTable(), array('value' => $this->_prepareValueForSave($value, $attribute)), 'value_id=' . (int) $valueId);
}
return $this;
}
示例2: _updateAttribute
/**
* Update entity attribute value
*
* @param Varien_Object $object
* @param Mage_Eav_Model_Entity_Attribute_Abstract $attribute
* @param mixed $valueId
* @param mixed $value
* @return Mage_Eav_Model_Entity_Abstract
*/
protected function _updateAttribute($object, $attribute, $valueId, $value)
{
/**
* Update attribute value for store
*/
if ($attribute->isScopeStore()) {
$this->_updateAttributeForStore($object, $attribute, $value, $object->getStoreId());
} elseif ($attribute->isScopeWebsite()) {
if ($object->getStoreId() == 0) {
$this->_updateAttributeForStore($object, $attribute, $value, $object->getStoreId());
} else {
if (is_array($object->getStoreIds())) {
foreach ($object->getStoreIds() as $storeId) {
$this->_updateAttributeForStore($object, $attribute, $value, $storeId);
}
}
}
} else {
$this->_getWriteAdapter()->update($attribute->getBackend()->getTable(), array('value' => $value), 'value_id=' . (int) $valueId);
}
return $this;
}