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


PHP Varien_Event类代码示例

本文整理汇总了PHP中Varien_Event的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Event类的具体用法?PHP Varien_Event怎么用?PHP Varien_Event使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: update

 /**
  * @see MageUC_Developer_Bar_Panel_Interface::update(Varien_Event $event)
  */
 public function update(Varien_Event $event)
 {
     if ($event->getName() == self::EVENT_MAGE_LOG) {
         self::$_arData[] = array('message' => $event->getMessage(), 'level' => $event->getLevel(), 'file' => $event->getFile());
     }
     return;
 }
开发者ID:nicolas-bastien,项目名称:MagentoUnderControl,代码行数:10,代码来源:Log.php

示例2: getValidator

 /**
  * Get quote item validator/processor object
  *
  * @deprecated
  * @param   Varien_Event $event
  * @return  Mage_SalesRule_Model_Validator
  */
 public function getValidator($event)
 {
     if (!$this->_validator) {
         $this->_validator = Mage::getModel('salesrule/validator')->init($event->getWebsiteId(), $event->getCustomerGroupId(), $event->getCouponCode());
     }
     return $this->_validator;
 }
开发者ID:SalesOneGit,项目名称:s1_magento,代码行数:14,代码来源:Observer.php

示例3: prepareProductObserver

 private function prepareProductObserver(Mage_Catalog_Model_Product $product)
 {
     $event = new Varien_Event();
     $event->setProduct($product);
     $observer = new Varien_Event_Observer();
     $observer->setEvent($event);
     return $observer;
 }
开发者ID:giuseppemorelli,项目名称:magento-extension,代码行数:8,代码来源:ObjectChange.php

示例4: update

 /**
  * @see MageUC_Developer_Bar_Panel_Interface::update(Varien_Event $event)
  */
 public function update(Varien_Event $event)
 {
     if (!isset($this->_arEvents[$event->getName()])) {
         $this->_arEvents[$event->getName()] = 0;
     }
     $this->_arEvents[$event->getName()] += 1;
     $this->_totalEventDispatched++;
 }
开发者ID:nicolas-bastien,项目名称:MagentoUnderControl,代码行数:11,代码来源:Event.php

示例5: buildObserver

 /**
  * Build correct observer structure
  *
  * @param $data array
  */
 protected function buildObserver(array $data)
 {
     $observer = new Varien_Event_Observer();
     $event = new Varien_Event();
     $event->setData($data);
     $data['event'] = $event;
     $observer->setData($data);
     return $observer;
 }
开发者ID:eniuz,项目名称:FrontendMonitoring,代码行数:14,代码来源:Observer.php

示例6: dispatchEvent

 /**
  * @see Mage_Core_Model_App::dispatchEvent($eventName, $args)
  */
 public function dispatchEvent($eventName, $args)
 {
     $event = new Varien_Event($args);
     $event->setName($eventName);
     $observer = new Varien_Event_Observer();
     $observer->setData(array('event' => $event));
     $observer->addData($args);
     $this->_bar->update($observer->getEvent());
     return parent::dispatchEvent($eventName, $args);
 }
开发者ID:nicolas-bastien,项目名称:MagentoUnderControl,代码行数:13,代码来源:App.php

示例7: addRewardsCatalogTaxDiscounts

 /** 
  * Adds the rewards catalog spending rule discounts to the tax display amount
  * @param Varien_Event $observer
  */
 public function addRewardsCatalogTaxDiscounts($observer)
 {
     $event = $observer->getEvent();
     $block = $event->getBlock();
     if ($block instanceof Mage_Tax_Block_Checkout_Grandtotal && $block->getTotal()) {
         $event->getBlock()->setTemplate('rewards/checkout/total/tax/grandtotal.phtml');
         $event->getBlock()->setTotalExclTaxExclCatalogRedem($this->getTotalExclTax($block));
     }
     return $this;
 }
开发者ID:rajarshc,项目名称:Rooja,代码行数:14,代码来源:Grandtotal.php

示例8: afterOutput

 /**
  * Executed from the core_block_abstract_to_html_after event
  * @param Varien_Event $obj
  */
 public function afterOutput($obj)
 {
     $block = $obj->getEvent()->getBlock();
     $transport = $obj->getEvent()->getTransport();
     // Magento 1.4.0.1 and lower dont have this transport, so we can't do autointegration : (
     if (empty($transport)) {
         return $this;
     }
     $this->_afterOutput($block, $transport);
     return $this;
 }
开发者ID:rajarshc,项目名称:Rooja,代码行数:15,代码来源:Observer.php

示例9: dispatchEvent

 /**
  * @param $model string model syntax or class name (codex_module/observer or Codex_Module_Model_Observer)
  * @param $method string the exact method name (as defined in confix.xml)
  * @param $eventName string the original name of the event
  * @param array $args array
  */
 public static function dispatchEvent($model, $method, $eventName, array $args = array())
 {
     $event = new Varien_Event($args);
     $event->setName($eventName);
     $observer = new Varien_Event_Observer();
     $observer->setData(array('event' => $event));
     $observer->addData($args);
     $object = Mage::getModel($model);
     if (method_exists($object, $method)) {
         $object->{$method}($observer);
     }
 }
开发者ID:nhp,项目名称:Xtest,代码行数:18,代码来源:Xtest.php

示例10: testScheduleOrderSync

 /**
  * @test
  * @loadFixture
  */
 public function testScheduleOrderSync()
 {
     $model = Mage::getModel("klevu_search/observer");
     $order = Mage::getModel("sales/order")->load(1);
     $event = new Varien_Event();
     $event->addData(array("event_name" => "sales_order_place_after", "order" => $order));
     $observer = new Varien_Event_Observer();
     $observer->addData(array("event" => $event));
     $model->scheduleOrderSync($observer);
     $this->assertEquals(array(array("order_item_id" => "2")), $this->getOrderSyncQueue());
     $this->assertEquals(1, $this->getOrderSyncCronScheduleCollection()->getSize(), "Failed to assert that scheduleOrderSync() schedules the Order Sync cron when called.");
 }
开发者ID:mSupply,项目名称:runnable_test_repo,代码行数:16,代码来源:Observer.php

示例11: afterOutput

 /**
  * Executed from the core_block_abstract_to_html_after event
  * @param Varien_Event $obj
  */
 public function afterOutput($obj)
 {
     $block = $obj->getEvent()->getBlock();
     $transport = $obj->getEvent()->getTransport();
     // Magento 1.3 and lower dont have this transport, so we can't do autointegration : (
     if (empty($transport)) {
         return $this;
     }
     $this->appendToSignupForm($block, $transport);
     $this->appendToOnepageCheckoutSignup($block, $transport);
     return $this;
 }
开发者ID:rajarshc,项目名称:Rooja,代码行数:16,代码来源:Register.php

示例12: update

 /**
  * @see MageUC_Developer_Bar_Panel_Interface::update(Varien_Event $event)
  */
 public function update(Varien_Event $event)
 {
     if (!$this->_profilerEnabled) {
         Mage::getSingleton('core/resource')->getConnection('core_write')->getProfiler()->setEnabled(true);
         $this->_profilerEnabled = true;
     }
     if ($event->getName() == MageUC_Developer_Bar::EVENT_POST_DISPATCH) {
         $conn = Mage::getSingleton('core/resource')->getConnection('core_write');
         $this->_profiler = $conn->getProfiler();
     }
     return;
 }
开发者ID:nicolas-bastien,项目名称:MagentoUnderControl,代码行数:15,代码来源:Database.php

示例13: afterOutput

 /**
  * Executed from the core_block_abstract_to_html_after event
  * @param Varien_Event $obj
  */
 public function afterOutput($obj)
 {
     $block = $obj->getEvent()->getBlock();
     $transport = $obj->getEvent()->getTransport();
     // Magento 1.3 and lower dont have this transport, so we can't do autointegration : (
     if (empty($transport)) {
         return $this;
     }
     $this->appendRewardsHeader($block, $transport);
     $this->appendCartPointsSpender($block, $transport);
     $this->appendPointsSummary($block, $transport);
     return $this;
 }
开发者ID:rajarshc,项目名称:Rooja,代码行数:17,代码来源:Output.php

示例14: testDispatchEventDoesNotCallApiIfNoMessages

 public function testDispatchEventDoesNotCallApiIfNoMessages()
 {
     $e = new Varien_Event();
     $e->setName('triggerCode');
     $observer = new Varien_Event_Observer();
     $observer->setEvent($e);
     $events = $this->getEventCollection();
     $this->observer->expects($this->once())->method('getEvents')->with('event', 'triggerCode')->will($this->returnValue($events));
     $messages = array();
     $this->messageProcessor->expects($this->once())->method('processEvents')->with($events, $observer)->will($this->returnValue($messages));
     $this->esendexApi->expects($this->never())->method('sendMultipleMessages');
     $this->observer->dispatchEvent($observer);
 }
开发者ID:WeareJH,项目名称:esendex-magento-extension,代码行数:13,代码来源:ObserverTest.php

示例15: testGoogleAnonymizationDisabled

 /**
  * @test
  * @loadFixture testGoogleAnonymizationDisabled
  */
 public function testGoogleAnonymizationDisabled()
 {
     $block = $this->app()->getLayout()->createBlock('googleanalytics/ga')->setTemplate('googleanalytics/ga.phtml');
     $transport = new Varien_Object();
     $transport->setHtml($block->toHtml());
     $event = new Varien_Event();
     $event->setData('block', $block);
     $event->setData('transport', $transport);
     $observer = new Varien_Event_Observer();
     $observer->setEvent($event);
     $this->_model->setGAAnonymizerCode($observer);
     $this->assertNotContains('_anonymizeIp', $observer->getEvent()->getTransport()->getHtml());
 }
开发者ID:mrafulfill,项目名称:firegento-magesetup,代码行数:17,代码来源:Observer.php


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