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


PHP Varien_Event_Observer::getDataObject方法代码示例

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


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

示例1: coreConfigSaveCommitAfter

 /**
  * Clear customer segment indexer if customer segment is on|off on backend
  *
  * @param Varien_Event_Observer $observer
  * @return Enterprise_TargetRule_Model_Observer
  */
 public function coreConfigSaveCommitAfter(Varien_Event_Observer $observer)
 {
     if ($observer->getDataObject()->getPath() == 'customer/enterprise_customersegment/is_enabled' && $observer->getDataObject()->isValueChanged()) {
         Mage::getSingleton('index/indexer')->logEvent(new Varien_Object(array('type_id' => null, 'store' => null)), Enterprise_TargetRule_Model_Index::ENTITY_TARGETRULE, Enterprise_TargetRule_Model_Index::EVENT_TYPE_CLEAN_TARGETRULES);
         Mage::getSingleton('index/indexer')->indexEvents(Enterprise_TargetRule_Model_Index::ENTITY_TARGETRULE, Enterprise_TargetRule_Model_Index::EVENT_TYPE_CLEAN_TARGETRULES);
     }
     return $this;
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:14,代码来源:Observer.php

示例2: configSaveAfter

 /**
  * Entry point for the observer.
  *
  * @param Varien_Event_Observer $observer
  * @return \Rubic_MigrationHelper_Model_Observer
  */
 public function configSaveAfter($observer)
 {
     $data = $observer->getDataObject();
     if ($data->isValueChanged()) {
         /**
          * Generate a message from migration data.
          */
         $migration = array('path' => $data->getPath(), 'value' => $data->getValue(), 'scope' => $data->getScope(), 'scope_id' => $data->getScopeId());
         $message = Mage::getModel('migration_helper/message_migration', $migration);
         /**
          * Log the migration, just in case.
          */
         Mage::log($migration, null, 'migrations.log');
         /**
          * Generate a physical migration if module is configured that way.
          */
         if ($this->_doGenerateMigrations()) {
             $this->_generateMigration($message);
         }
         /**
          * Add the message to the admin session.
          */
         $this->_getAdminSession()->addMessage($message);
     }
     return $this;
 }
开发者ID:victso,项目名称:MigrationHelper,代码行数:32,代码来源:Observer.php

示例3: sendVoucherOnStatusChange

 public function sendVoucherOnStatusChange(Varien_Event_Observer $observer)
 {
     $order = $observer->getDataObject();
     $incrementId = $order->getIncrementId();
     if (!in_array($order->getStatus(), explode(',', Mage::getStoreConfig('voucher_options/configs/order_status_admin')))) {
         return;
     }
     $vouchers = Mage::getModel('voucher/vouchers')->getCollection()->addFieldToFilter('order_increment_id', $incrementId);
     foreach ($vouchers as $voucher) {
         $this->_sendVoucherEmail($voucher, $order);
     }
 }
开发者ID:liemnv,项目名称:Groupon-Clone-On-Magento,代码行数:12,代码来源:Observer.php

示例4: productLoadAfter

 /**
  * Attach children products after product load
  * Observes: catalog_product_load_after
  *
  * @param Varien_Event_Observer $observer
  */
 public function productLoadAfter(Varien_Event_Observer $observer)
 {
     if (!Mage::helper('configurableswatches')->isEnabled()) {
         // functionality disabled
         return;
         // exit without loading swatch functionality
     }
     /* @var $helper Mage_ConfigurableSwatches_Helper_Mediafallback */
     $helper = Mage::helper('configurableswatches/mediafallback');
     /* @var $product Mage_Catalog_Model_Product */
     $product = $observer->getDataObject();
     if ($product->getTypeId() != Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE) {
         return;
     }
     $helper->groupMediaGalleryImages($product);
     $helper->attachConfigurableProductChildrenAttributeMapping(array($product), $product->getStoreId());
 }
开发者ID:quyip8818,项目名称:Mag,代码行数:23,代码来源:Observer.php

示例5: registerDesignExceptionsChange

 /**
  * Resave exception rules to cache storage
  *
  * @param Varien_Event_Observer $observer
  * @return Enterprise_PageCache_Model_Observer
  */
 public function registerDesignExceptionsChange(Varien_Event_Observer $observer)
 {
     $object = $observer->getDataObject();
     Enterprise_PageCache_Model_Cache::getCacheInstance()->save($object->getValue(), Enterprise_PageCache_Model_Processor::DESIGN_EXCEPTION_KEY, array(Enterprise_PageCache_Model_Processor::CACHE_TAG));
     return $this;
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:12,代码来源:Observer.php

示例6: saveProduct

 public function saveProduct(Varien_Event_Observer $observer)
 {
     $product = $observer->getDataObject();
     $product = Mage::getModel('catalog/product')->load($product->getId());
     Algolia_Algoliasearch_Model_Indexer_Algolia::$product_categories[$product->getId()] = $product->getCategoryIds();
 }
开发者ID:IvanRybakov,项目名称:algoliasearch-magento,代码行数:6,代码来源:Observer.php

示例7: onStockItemSaveAfter

 public function onStockItemSaveAfter(Varien_Event_Observer $observer)
 {
     if ($observer->getDataObject() && $observer->getDataObject()->getProductId()) {
         $productId = $observer->getDataObject()->getProductId();
         Mirasvit_Fpc_Model_Cache::getCacheInstance()->clean('CATALOG_PRODUCT_' . $productId);
     }
 }
开发者ID:vinayshuklasourcefuse,项目名称:sareez,代码行数:7,代码来源:Observer.php

示例8: rmaSaveAfter

 /**
  * Method observes core_abstract_save_after event
  * as far as Enterprise_Rma_Model_Rma doesn't have own event prefix
  *
  * @param Varien_Event_Observer $observer
  */
 public function rmaSaveAfter(Varien_Event_Observer $observer)
 {
     try {
         /* will listen to Enterprise_Rma_Model_Rma only*/
         $dataObject = $observer->getDataObject();
         if (get_class($dataObject) === 'Enterprise_Rma_Model_Rma') {
             if ($dataObject->getStatus() == 'closed') {
                 //send partial order return message
             }
         }
     } catch (Exception $exception) {
         $this->_handleException($exception);
     }
 }
开发者ID:ridhoq,项目名称:mxpi-twitter,代码行数:20,代码来源:Observer.php


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