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 syncMappingAccountBefore(Varien_Event_Observer $observer) {
        		/**
         		 * Mapping objects
         		 * @var TNW_QuoteSalesforce_Model_Sync_Mapping_QuoteCustomer_OpportunityAccount $_mapping 
         		 * 
         		 * Example:
        		 *     object(TNW_QuoteSalesforce_Model_Sync_Mapping_QuoteCustomer_OpportunityAccount)[716530]
         		 *       protected '_type' => string 'QuoteAccount' (length=57)         // used $_mapping->getType()
        		 *       protected '_allowedMappingTypes' =>                    // used $_mapping->getAllowedMappingTypes()
         		 *         array (size=6)
         		 *           0 => string 'Customer' (length=8)
        		 *           1 => string 'BillingCustomer Group' (length=714)
         		 *           2 => string 'ShippingBilling' (length=87)
         		 *           3 => string 'CustomShipping' (length=68)
         		 *           4 => string 'QuoteAitoc' (length=5)
         		 *           5 => string 'Customer GroupCustom' (length=146)
         		 *       protected '_mappingCollection' => 	null       		          // used $_mapping->getMappingCollection()
         		 *       protected '_sync' =>                								                   // used $_mapping->getSync()
        		 *         object(TNW_Quote_Helper_Salesforce_Cart2quote)
         		 *       ...
         		 */
        		$_mapping = $observer->getData('mapping');


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


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


		// Your custom code
    }
 
}

...