_lastRawResponse = $response; // Convert the result from JSON format to a PHP array return json_decode($response,true); } protected function _returnLastRawResponse() { return "Error in web services call. Response was: {$this->_lastRawResponse}"; } /** * _login * * This function helps make the login call * * @param $user The SugarCRM User bean instance to login with * @return mixed The REST response from the login operation */ protected function _login($user) { $GLOBALS['db']->commit(); // Making sure we commit any changes before logging in return $this->_makeRESTCall('login', array( 'user_auth' => array( 'user_name' => $user->user_name, 'password' => $user->user_hash, 'version' => '.01', ), 'application_name' => 'mobile', 'name_value_list' => array(), ) ); } }