public function savePreferences($data) {
        $response=CodeBank_ClientAPI::responseBase();
        
        try {
            $member=Member::currentUser();
            if($member && $member->ID!=0) {
                $member->UseHeartbeat=($data->heartbeat==1 ? true:false);
                $member->write();
            }else {
                throw new Exception('Not Logged In!');
            }
            
            
            $response['status']='HELO';
            $response['message']=_t('CodeBankAPI.PREFERENCES_SAVED', '_Preferences saved successfully');
        }catch (Exception $e) {
            $response['status']='EROR';
            $response['message']=_t('CodeBankAPI.SERVER_ERROR', '_Server error has occured, please try again later');
        }
        
        return $response;
    }
public function savePreferences($data) {
        $response=CodeBank_ClientAPI::responseBase();
        
        try {
            $member=Member::currentUser();
            if($member && $member->ID!=0) {
                $member->UseHeartbeat=($data->heartbeat==1 ? true:false);
                $member->write();
            }else {
                throw new Exception('Not Logged In!');
            }
            
            
            $response['status']='HELO';
            $response['message']=_t('CodeBankAPI.PREFERENCES_SAVED', '_Preferences saved successfully');
        }catch (Exception $e) {
            $response['status']='EROR';
            $response['message']=_t('CodeBankAPI.SERVER_ERROR', '_Server error has occured, please try again later');
        }
        
        return $response;
    }
public function savePreferences ( $ data ) { $ response = CodeBank_ClientAPI :: responseBase ( ) ; try { $ member = Member :: currentUser ( ) ; if ( $ member && $ member -> ID != 0 ) { $ member -> UseHeartbeat = ( $ data -> heartbeat == 1 ? true : false ) ; $ member -> write ( ) ; } else { throw new Exception ( 'Not Logged In!' ) ; } $ response [ 'status' ] = 'HELO' ; $ response [ 'message' ] = _t ( 'CodeBankAPI.PREFERENCES_SAVED' , '_Preferences saved successfully' ) ; } catch ( Exception $ e ) { $ response [ 'status' ] = 'EROR' ; $ response [ 'message' ] = _t ( 'CodeBankAPI.SERVER_ERROR' , '_Server error has occured, please try again later' ) ; } return $ response ; }
Saves users server preferences
@param {stdClass} $data Data passed from ActionScript
@return {array} Standard response base
Saves users server preferences