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 websiteSendAfter(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');

		/** 
		 * Array of Results
		 * @var array $_result
		 * 
		 * Example:
		 * array (size=1)
		 *   0 => 
		 *     object(stdClass)[352]
		 *       public 'created' => boolean false
		 *       public 'id' => string 'a002400000CSEG8AAP' (length=18)
		 *       public 'success' => boolean true
		 */
		$_result = $observer->getData('result');

		// Your custom code
    }
 
}

...