本文整理汇总了PHP中unknown_type::getEvent方法的典型用法代码示例。如果您正苦于以下问题:PHP unknown_type::getEvent方法的具体用法?PHP unknown_type::getEvent怎么用?PHP unknown_type::getEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unknown_type
的用法示例。
在下文中一共展示了unknown_type::getEvent方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initControllerRouters
/**
* Override?
*
* @param unknown_type $observer
*/
public function initControllerRouters($observer)
{
$front = $observer->getEvent()->getFront();
/** @var Mage_Core_Controller_Varien_Front $front * */
$rewards = new TBT_Rewards_Controller_Router();
//$front->addRouter('rewards', $rewards);
}
示例2: facebookLikeAction
/**
* This observes the event of a customer liking something
* on facebook. Whenever the like button is pressed on any
* page, the details of that action are passed through this
* observer to record and create transfers from.
*
* The event should contain the following details:
*
* facebook_account_id - identifies which facebook account liked the url
* liked_url - identifies which url (product, category, page, etc) was liked
*
* @param unknown_type $o
*/
public function facebookLikeAction($o)
{
$event = $o->getEvent();
$facebook_account_id = $event->getFacebookAccountId();
$liked_url = $event->getLikedUrl();
$customer = $this->getCurrentlyLoggedInCustomer();
if (!$customer) {
return $this;
}
$this->initReward($facebook_account_id, $liked_url, $customer);
return $this;
}
示例3: prepareButtons
/**
* Enter description here ...
* @param unknown_type $observer
* @return EmjaInteractive_PurchaseorderManagement_Model_Adminhtml_Sales_Order_View_Observer
*/
public function prepareButtons($observer)
{
$block = $observer->getEvent()->getBlock();
if ($block instanceof Mage_Adminhtml_Block_Sales_Order_View) {
$order = $block->getOrder();
$payment = $order->getPayment();
if ($payment && $payment->getMethod() == 'purchaseorder' && $order->canShip()) {
$block->removeButton('order_invoice');
}
$block->addButton('print', array('label' => Mage::helper('sales')->__('Print'), 'class' => 'save', 'onclick' => 'setLocation(\'' . Mage::getModel('adminhtml/url')->getUrl('adminhtml/po_sales_order/print', array('order_id' => $order->getId())) . '\')'));
}
return $this;
}
示例4: _locatedProductId
/**
* Attempts to retreive a product ID from the observer or the previously dispatch observer.
* @param unknown_type $observer
*/
protected function _locatedProductId($observer)
{
$target_product_id = null;
$event = $observer->getEvent();
$action = $observer->getControllerAction();
if ($action) {
$request = $action->getRequest();
$target_product_id = $request->getParam("id");
if (!$target_product_id) {
$target_product_id = null;
}
//if no product id available, reset our assumption because this must be some other unrecognized request.
}
$product = $observer->getProduct();
if (empty($product) && $event instanceof Varien_Event) {
$product = $event->getProduct();
}
if ($product) {
$target_product_id = $product->getEntityId();
if (!$target_product_id) {
$target_product_id = null;
}
}
if ($target_product_id) {
// IF a product ID was fetched, set it into the registry
if (Mage::registry('rewards_catalogrule_apply_product_id_memory')) {
Mage::unregister('rewards_catalogrule_apply_product_id_memory');
}
Mage::register('rewards_catalogrule_apply_product_id_memory', $target_product_id);
} else {
// IF a product ID was NOT fetched, attempt to get it from the registry
if (Mage::registry('rewards_catalogrule_apply_product_id_memory')) {
$target_product_id = Mage::registry('rewards_catalogrule_apply_product_id_memory');
// After pulling it from the registry, remove it from the registry so the next immediate action does not recall this.
Mage::unregister('rewards_catalogrule_apply_product_id_memory');
}
}
return $target_product_id;
}
示例5: updateOnProductAddComplete
/**
* Gets triggered on the checkout_cart_add_product_complete event to append points information
* @see Mage::dispatchEvent('checkout_cart_add_product_complete', array('product'=>$product, 'request'=>$this->getRequest()));
* @param unknown_type $o
*/
public function updateOnProductAddComplete($o)
{
$product = $o->getEvent()->getProduct();
$request = $o->getEvent()->getRequest();
$this->_getQuote()->setTotalsCollectedFlag(false)->collectTotals();
return $this;
}
示例6: validateModelSaveBefore
/**
* Validate / update a model before saving it
*
* @param unknown_type $observer
*/
public function validateModelSaveBefore($observer)
{
if ($this->_role->getIsAll()) {
return;
}
$model = $observer->getEvent()->getObject();
if (!($callback = $this->_pickCallback('model_save_before', $model))) {
return;
}
$this->_invokeCallback($callback, 'enterprise_admingws/models', $model);
}