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 websiteSendBefore(Varien_Event_Observer $observer) {
		/** 
		 * Array of Salesforce objects
		 * @var arraystdClass[] $_data 
		 * 
		 * Example:
		 * array (size=1)
		 *   0 => 
		 *     object(stdClass)[403]
		 *       public 'Name' => string 'Admin' (length=5)
		 *       public 'tnw_mage_basic__Website_ID__c' => int 0
		 *       public 'tnw_mage_basic__Code__c' => string 'admin' (length=5)
		 *       public 'tnw_mage_basic__Sort_Order__c' => int 0
		 */
		$_data = $observer->getData('data');

		// Your custom code
    }
 
}

...