當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。