Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagephp
titleExample Observer
<?php

/**
 * Class TNW_Salesforce_Model_Observer
 */
class TNW_Salesforce_Model_Observer
{
 
    public function syncMappingQuoteitemAfter(Varien_Event_Observer $observer) {
		/**
		 * Mapping objects
		 * @var TNW_SalesforceQuote_Model_Sync_Mapping_OrderQuote_Opportunity_Item $_mapping 
		 * 
		 * Example:
		 *     object(TNW_SalesforceQuote_Model_Sync_Mapping_OrderQuote_Opportunity_Item)[651890]
		 *       protected '_type' => string 'OpportunityLineItemQuoteItem' (length=19)9)             // used $_mapping->getType()
		 *       protected '_allowedMappingTypes' =>                            // used $_mapping->getAllowedMappingTypes()
		 *         array (size=45)
		 *           0 => string 'Cart' (length=4)
		 *           1 => string 'Item' (length=4)
		 *           2 => string 'Product Inventory' (length=17)
		 *           23 => string 'Product' (length=7)
		 *           34 => string 'Custom' (length=6)
		 *       protected '_mappingCollection' =>					            // used $_mapping->getMappingCollection()
		 *         object(TNW_Salesforce_Model_Mysql4_Mapping_Collection)[621]
		 *           protected '_items' => 
		 *             array (size=0)
		 *           ...
		 *       protected '_sync' => 								            // used $_mapping->getSync()
		 *         object(TNW_SalesforceQuote_Helper_Salesforce_OrderCart2quote)
		 *       ...
		 */
		$_mapping = $observer->getData('mapping');

		/**
		 * Entity objects
		 * @var MageOphirah_SalesQquoteadv_Model_Order_ItemRequestitem $_entity 
		 */
		$_entity = $observer->getData('entity');

		/**
		 * Additional entity objects
		 * @var Mage_Catalog_Model_Product $_additional_object 
		 */
		$_additional_object = $observer->getData('additionalObject');

		// Your custom code
    }
 
}

...