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 taskSendBefore(Varien_Event_Observer $observer) {
		/** 
		 * Array of Salesforce objects
		 * @var arraystdClass[] $_data 
		 * 
		 * Example:
		 * array (size=1)
		 *   0 => 
		 *     object(stdClass)[191]
		 *       public 'WhoId' => string '0032400000MFktIAAT' (length=18)
		 *       public 'Subject' => string 'Contact form request' (length=20)
		 *       public 'Status' => string 'Not Started' (length=11)
		 *       public 'Priority' => string 'High' (length=4)
		 *       public 'Description' => string 'Test Comment' (length=12)
		 *       public 'OwnerId' => string '00524000001veuuAAA' (length=18)
		 */
		$_data = $observer->getData('data');

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

		// Your custom code
    }
 
}

...