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


PHP Varien_Event_Observer::getEventName方法代码示例

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


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

示例1: eavAttributeChange

 /**
  * Update all attribute-dependant index
  *
  * @param Varien_Event_Observer $observer
  * @return Mage_CatalogSearch_Model_Fulltext_Observer
  */
 public function eavAttributeChange(Varien_Event_Observer $observer)
 {
     $attribute = $observer->getEvent()->getAttribute();
     /* @var $attribute Mage_Eav_Model_Entity_Attribute */
     $entityType = Mage::getSingleton('eav/config')->getEntityType(Mage_Catalog_Model_Product::ENTITY);
     /* @var $entityType Mage_Eav_Model_Entity_Type */
     if ($attribute->getEntityTypeId() != $entityType->getId()) {
         return $this;
     }
     $delete = $observer->getEventName() == 'eav_entity_attribute_delete_after';
     if (!$delete && !$attribute->dataHasChangedFor('is_searchable')) {
         return $this;
     }
     $showNotice = false;
     if ($delete) {
         if ($attribute->getIsSearchable()) {
             $showNotice = true;
         }
     } elseif ($attribute->dataHasChangedFor('is_searchable')) {
         $showNotice = true;
     }
     if ($showNotice) {
         $url = Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/system_cache');
         Mage::getSingleton('adminhtml/session')->addNotice(Mage::helper('catalogsearch')->__('Attribute setting change related with Search Index. Please run <a href="%s">Rebuild Search Index</a> process.', $url));
     }
     return $this;
 }
开发者ID:hirentricore,项目名称:devmagento,代码行数:33,代码来源:Observer.php

示例2: addObserver

 /**
  * Register an observer
  * 
  * If observer has event_name property it will be regitered for this specific event.
  * If not it will be registered as global observer
  *
  * @param Varien_Event_Observer $observer
  * @return Varien_Event_Collection
  */
 public function addObserver(Varien_Event_Observer $observer)
 {
     $eventName = $observer->getEventName();
     if ($eventName) {
         $this->getEventByName($eventName)->addObserver($observer);
     } else {
         $this->getGlobalObservers()->addObserver($observer);
     }
     return $this;
 }
开发者ID:natxetee,项目名称:magento2,代码行数:19,代码来源:Collection.php

示例3: clearPaymentMethodFromQuote

 /**
  * in some cases the payment method is not set properly by Magento so we need to reset the
  * payment method in the quote's payment before importing the data
  *
  * @event sales_quote_payment_import_data_before
  * @param $observer
  * @return $this
  */
 public function clearPaymentMethodFromQuote(Varien_Event_Observer $observer)
 {
     if ($observer->getEventName() == 'sales_quote_payment_import_data_before' && $observer->getEvent()->getPayment() instanceof Mage_Sales_Model_Quote_Payment) {
         $observer->getEvent()->getPayment()->setMethod(null);
     }
     return $this;
 }
开发者ID:roshu1980,项目名称:add-computers,代码行数:15,代码来源:Observer.php


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