當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Varien_Event_Observer::getAttribute方法代碼示例

本文整理匯總了PHP中Varien_Event_Observer::getAttribute方法的典型用法代碼示例。如果您正苦於以下問題:PHP Varien_Event_Observer::getAttribute方法的具體用法?PHP Varien_Event_Observer::getAttribute怎麽用?PHP Varien_Event_Observer::getAttribute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Varien_Event_Observer的用法示例。


在下文中一共展示了Varien_Event_Observer::getAttribute方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: processAttributeChangeEvent

 /**
  * Process index data after attribute information was changed
  *
  * @param   Varien_Event_Observer $observer
  * @return  Mage_CatalogIndex_Model_Observer
  */
 public function processAttributeChangeEvent(Varien_Event_Observer $observer)
 {
     /**
      * @todo add flag to attribute model which will notify what options was changed
      */
     $attribute = $observer->getAttribute();
     $tags = array(Mage_Eav_Model_Entity_Attribute::CACHE_TAG . ':' . $attribute->getId());
     if ($attribute->getOrigData('is_filterable') != $attribute->getIsFilterable()) {
         if ($attribute->getIsFilterable() != 0) {
             $this->_getIndexer()->plainReindex(null, $attribute);
         } else {
             $this->_getAggregator()->clearCacheData($tags);
         }
     } elseif ($attribute->getIsFilterable()) {
         $this->_getAggregator()->clearCacheData($tags);
     }
     return $this;
 }
開發者ID:HelioFreitas,項目名稱:magento-pt_br,代碼行數:24,代碼來源:Observer.php

示例2: saveAttributeData

 /**
  * @param Varien_Event_Observer $observer
  * @return $this
  */
 public function saveAttributeData($observer)
 {
     /** @var $connection Varien_Db_Adapter_Pdo_Mysql */
     $connection = Mage::getSingleton('core/resource')->getConnection('read');
     $table = Mage::getSingleton('core/resource')->getTableName('ecommerceteam_sln_attribute_data');
     $attributeId = (int) $observer->getAttribute()->getAttributeId();
     $groupId = addslashes($observer->getAttribute()->getData('group_id'));
     $frontendType = addslashes($observer->getAttribute()->getData('frontend_type'));
     $comment = $observer->getAttribute()->getData('comment');
     $optionsLimit = $observer->getAttribute()->getData('options_limit');
     $connection->insertOnDuplicate($table, array('attribute_id' => $attributeId, 'group_id' => $groupId, 'frontend_type' => $frontendType, 'comment' => $comment, 'options_limit' => $optionsLimit));
     return $this;
 }
開發者ID:xiaoguizhidao,項目名稱:devfashion,代碼行數:17,代碼來源:Observer.php


注:本文中的Varien_Event_Observer::getAttribute方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。