本文整理汇总了PHP中Mage_Eav_Model_Entity_Attribute_Abstract::isScopeGlobal方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Eav_Model_Entity_Attribute_Abstract::isScopeGlobal方法的具体用法?PHP Mage_Eav_Model_Entity_Attribute_Abstract::isScopeGlobal怎么用?PHP Mage_Eav_Model_Entity_Attribute_Abstract::isScopeGlobal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Eav_Model_Entity_Attribute_Abstract
的用法示例。
在下文中一共展示了Mage_Eav_Model_Entity_Attribute_Abstract::isScopeGlobal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: callbackFilterMotorsAttribute
public function callbackFilterMotorsAttribute(Varien_Data_Collection_Db $collection, $column)
{
$value = $column->getFilter()->getValue();
if (is_null($value)) {
return;
}
if (!$this->motorsAttribute) {
return;
}
if ($value == 1) {
$attributeCode = $this->motorsAttribute->getAttributeCode();
$collection->addFieldToFilter($attributeCode, array('notnull' => true));
$collection->addFieldToFilter($attributeCode, array('neq' => ''));
$collection->addFieldToFilter('is_motors_attribute_in_product_attribute_set', array('notnull' => true));
} else {
$attributeId = $this->motorsAttribute->getId();
$storeId = $this->getListing()->getStoreId();
$joinCondition = 'eaa.entity_id = e.entity_id and eaa.attribute_id = ' . $attributeId;
if (!$this->motorsAttribute->isScopeGlobal()) {
$joinCondition .= ' and eaa.store_id = ' . $storeId;
}
$collection->getSelect()->joinLeft(array('eaa' => Mage::getSingleton('core/resource')->getTableName('catalog_product_entity_text')), $joinCondition, array('value'));
$collection->getSelect()->orWhere('eaa.value IS NULL');
$collection->getSelect()->orWhere('eaa.value = \'\'');
$collection->getSelect()->orWhere('eea.entity_attribute_id IS NULL');
}
}
示例2: deleteProductData
/**
* Delete product data
*
* @param Mage_Catalog_Model_Product $product
* @param Mage_Eav_Model_Entity_Attribute_Abstract $attribute
* @return Mage_Weee_Model_Resource_Attribute_Backend_Weee_Tax
*/
public function deleteProductData($product, $attribute)
{
$where = array('entity_id = ?' => (int) $product->getId(), 'attribute_id = ?' => (int) $attribute->getId());
$adapter = $this->_getWriteAdapter();
if (!$attribute->isScopeGlobal()) {
$storeId = $product->getStoreId();
if ($storeId) {
$where['website_id IN(?)'] = array(0, Mage::app()->getStore($storeId)->getWebsiteId());
}
}
$adapter->delete($this->getMainTable(), $where);
return $this;
}