SalesforceAccessTokenV2_9
receives an array
'credentials_array'=>
'refresh_token'=>,
'consumer_key,
'consumer_secret'=>,
returns access_token
-
Method
- extract_needed_parameters protected
- Method
- build_response_messages protected
- Method
- build_final_http_args protected
- Method
- build_url protected
- Method
- extract_data_from_response_body protected
- Method
- get_instance_url public
- Method
- get_access_token public
SalesforceRefreshToken
Grabs the client_id, client_secret, and authorization_code from the settings in the options database Returns the refresh token and instance Accessed on the Settings Pages, this class generates the token and instance to be stored in the options database for use during each form submission Receives parameter_array 'client_id' => 'client_secret' => 'authorization_code' => writes the refresh token directly into the options database
-
Method
- extract_needed_parameters protected
- Method
- build_response_messages protected
- Method
- build_url protected
- Method
- build_final_http_args protected
- Method
- extract_data_from_response_body protected
- Method
- get_refresh_token public
SalesforceSecurityCredentials_V2_9
Structure of returned array 'result' 'comm_data' //-comm_data_array structure-// ) 'data'=>array( 'refresh_token'=>, 'consumer_key, 'consumer_secret'=>, )
-
Method
- __construct
- Method
- extract_consumer_key private
- Method
- extract_consumer_secret private
- Method
- extract_refresh_token private
- Method
- extract_password private
- Method
- get_credentials_array public
- Method
- get_comm_data public
SalesforceVersion_V2_9
Grabs a list of available verions Sets the version_url to the lates version Receives parameter_array['instance']
-
Method
- extract_needed_parameters protected
- Method
- build_response_messages protected
- Method
- build_url protected
- Method
- build_final_http_args protected
- Method
- extract_data_from_response_body protected
- Method
- get_version_url public
SalesforceBuildRequestV2_9
-
Method
- __construct // specifies the child objects and the child object field that uses the parent object id for linking
- Method
- link_child_objects public
- Method
- build_object_order protected
- Creates a default array of the order in which objects must be posted to ensure that the following objects can be linked to the newly created object's ID Method
- build_child_object_array protected
- Creates a default array of parent objects containing an array of child objects and the field name that links the child to the parent. Method
- iterate_field_array protected
- For NF 2.9 Cycle through the field array from ninja_forms_processing Extract the object and field map Calls method to validate form value Builds the unprioritized request array when finished cycling Method
- iterate_nf3_array protected
- Iterates array structure for NF3 and sends it to process method The Process Field method is shared with 2.9, so the special instructions are converted one by one into the 2.9 data structure to prevent 2.9 installs from breaking Method
- structureSpecialInstructions protected
-
Converts NF3 special instructions into a NF2.9-friendly data structure
Added February 2018 to refactor for simplifying structure
Paramarray $fieldReturnarray
Method
- process_field protected
-
Adds field to request array, given field data and raw form value
Paramarray $field field data structured as pre-3Parammixed $raw_form_value Submitted form value
Method
- validate_raw_form_value protected
-
Converts array values to comma separated string
Converts date interval into date set to the interval from the form
submission date
Paramtype $raw_form_valueParamtype $field_argsReturntype
Method
- formatSalesforceCurrency protected
-
Converts incoming field into Salesforce currency format (integer)
Added February 2018
Parammixed $value_inReturninteger
Method
- validate_unprioritized_request_array protected
- Check if unprioritized request array has any values before proceeding If not, update comm data and return false to halt processing of form Method
- reorder_request_array protected
- Sorts the unprioritized array into order needed for processing Done by adding the two-digit object order to the front of each object, sorting on the object key, then removing the object order Method
- build_object_request_list protected
- Builds a list of the objects from the prioritized list for iteration This is done so that after each new record added, the request array can be modified to insert the newly created object id for linking Method
- extract_field_settings protected
-
Extract the field arguments needed for validating each field
Set a default value for any field argument that may not be automatically set,
especially custom settings created by this extension
Currency field_arg added Feb 2018
Removed unneeded $field variable mods
Paramarray $fieldReturnarray
Method
- extract_object_and_field_map protected
-
Receives a string of the map argument set by the field registration
Explodes the map argument into a salesforce object and a salesforce field
Paramstring $map_argsReturnarray
Method
- strip_html_tags protected
-
Strips the HTML tags
NF3 escapes textarea tags; when these get sent to a custom field, these
tags appear as text. The new default function is to decode
and then strip these tags, then escape the result
A filter allows one to keep the new functionality
Paramtype $raw_form_value
Method
- get_request_array public
- Method
- get_duplicate_check_array public
- Method
- get_object_request_list public
- Method
- get_object_field_list public
SalesforceCommunicationV2_9
-
Method
- __construct
- Method
- make_it_so protected
- Method
- extract_needed_parameters protected
- Method
- build_default_http_args private
- Method
- build_final_http_args protected
- Method
- build_url protected
- Method
- build_response_messages protected
- Method
- retrieve_request private
- Method
- process_request private
- Method
- process_successful_response_20x protected
- Method
- extract_data_from_response_body protected
- Method
- process_bad_request_400 private
- Method
- extract_body_error_400_messages private
-
Analyzes the body of a 400 response to extract errors
Some errors are a single key-value pair while others are
an indexed array of key value pairs. There are also different
keys used for the errors. These must all be handled without
creating an error.
Returnarray $this->error_array
Method
- process_forbidden_403 private
- Method
- process_unhandled_response_codes private
- Method
- process_wp_error private
- Method
- process_failed_parameter_gatekeeper private
- Method
- get_processed_result_array public
- Method
- get_result public
- Method
- get_comm_data public
SalesforceDuplicateCheck
checks for a duplicate record by a given field in a given object Receives parameter_array 'instance' => 'version_url' => 'access_token' => 'object_name' => 'field_name' => 'field_value' =>
-
Method
- extract_needed_parameters protected
- Method
- build_response_messages protected
- Method
- build_url protected
- Method
- build_query_string protected
- Method
- build_final_http_args protected
- Method
- extract_data_from_response_body protected
- Method
- get_duplicate_check_response public
SalesforceDescribeObject
Returns the description of a given object Receives parameter_array 'instance' => 'version_url' => 'access_token' => 'object_name' =>
-
Method
- extract_needed_parameters protected
- Method
- build_response_messages protected
- Method
- build_url protected
- Method
- build_final_http_args protected
- Method
- extract_data_from_response_body protected
- Method
- get_object_description public
SalesforceListOfObjects
Builds an indexed array of object names
Receives parameter_array
'instance' =>
'version_url' =>
'access_token' =?
-
Method
- extract_needed_parameters protected
- Method
- build_response_messages protected
- Method
- build_url protected
- Method
- build_final_http_args protected
- Method
- extract_data_from_response_body protected
- Method
- get_list_of_objects public
SalesforcePostNewRecordObject_v2_9
Posts a new record into the specified object
-
Method
- extract_needed_parameters protected
- Method
- build_response_messages protected
- Method
- build_url protected
- Method
- build_final_http_args protected
- Method
- extract_data_from_response_body protected
- Method
- get_new_record_id public
SalesforcePostNewRecordObject_v2_9
-
Method
- nfsalesforcecrm_add_field_map_option
- Method
- nfsalesforcecrm_add_duplicate_check_checkbox
- Method
- nfsalesforcecrm_add_date_interval_option
- Method
- nfsalesforcecrm_add_format_as_date_option
- Method
- nfsalesforcecrm_mappable_field_types /** * Build a list of standard Ninja Form fields that are mappable * Enable via filter a way to add fields created by extensions * * @return array * */
SalesforcePostNewRecordObject_v2_9
-
Method
- nfsalesforcecrm_add_ua_extension_to_mappable_fields /* * Use array_merge to add an array of new field types from extensions to add * */
SalesforcePostNewRecordObject_v2_9
-
Method
- nfsalesforcecrm_process_form_to_insert_form_data /* * Process the submitted form to send the data to Salesforce * */
SalesforcePostNewRecordObject_v2_9
-
Method
- nfsalesforcecrm_extension_setup_license
- Method
- nfsalesforcecrm_extension_load_lang
- Method
- nfsalesforcecrm_frontend_hook
- Method
- nfsalesforcecrm_settings_page_hook /** * When the Salesforce settings page is loaded, check if desired to update * account objects; If yes, then refresh object and fields for specified objects * @global array $nfsalesforcecrm_settings * */
NF_SalesforceCRM_Actions_AddToSalesforce
-
Method
- __construct public
- Constructor Method
- enqueueAdminScripts public
- Method
- save public
- Method
- process public
- Method
- retrieveActionMessages protected
- Method
- instantiateFormProcessObject protected
- Instantiates the FormProcess object for processing Method
- injectRequestObject protected
-
Injects RequestObject into FormProcess object
If extending Request Object exists, injects that instead of standard
Method
- injectCommDataObject protected
- Includes, initializes, and injects CommData object into FormProcess object Method
- injectAnalyzeResponse protected
- Injects AnalyzeResponse object into FormProcess object Method
- injectSupportObject protected
- Injects NF_SalesforceCRM_Support object into FormProcess object Method
- builder_templates public
- Method
- init_settings public
- Method
- build_field_map_dropdown protected
-
Build the array of each field to be sent
Uses the reader-friendly name for both label and value. Processing can look up the programmatic value for mapping the requestParamtype $field_map_arrayReturnarray
Method
- scrub_action_settings protected
-
Remove unused dropdown options stored in specific action settings key
Paramtype $keyed_action_settings
Method
- replace_placeholders public
-
Replace placeholder tags with Action-generated text
$this->action_messages is a keyed collection of messages accrued during the action process; these messages will replace a given placeholder text in other actions, such as the success or email messages
Paramarray $action_settingsParamstring $form_idParamstring $action_idParamarray $form_settingsReturnarray
NF_SalesforceCRM_Admin_AdvancedCommands
Adds filters specified by an Advanced Command
Enables dashboard setting to apply hard coded filters
-
Method
- __construct public
-
Adds the Advanced Commands setting
Paramstring $settings_key NF Settings key where advanced commands field is stored
Method
- refreshSettings public
- Retrieves advanced command setting, generates advanced command array Checks setting from DB and sanitizes, then explodes and trims spaces Method
- advancedCommands public
-
Returns the stored advanced codes for the plugin
Returnarray Advanced codes as array
Method
- isAdvancedCommandSet public
-
Given an advanced command, evaluates if it is set or not
Paramstring $commandReturnbool TRUE is command is set, FALSE if not set
Method
- variableAdvancedCommand public
-
Searches advanced commands for variable values and returns variable
Given a prefixed command, returns suffix, false on fail
Paramstring $prefixReturnstring|false Variable value from advanced command, false on unmatched
Method
- intAdvancedCommmand public
-
Searches advanced commands for prefixed values and returns integer suffix
Given a prefixed command, returns integer, false on fail
Paramstring $prefixReturninteger|bool Description
Method
- arrayAdvancedCommmand public
-
Searches advanced commands for prefixed values and returns array suffix
Given a prefixed command, returns array, exploded on '-', false on fail
ex: samplecommand_A-B-C returns array (A,B,C)Paramstring $prefixReturnarray|bool Description
NF_SalesforceCRM_Admin_AdvancedCommands
-
Method
- nfsalesforce_load_globals /** * Retrieve db options as global variables to minimize db calls * * @var array $nfsalesforcecrm_settings Client ID, Secret, Authorization Code, and Objects to Refresh * @var array $nfsalesforcecrm_comm_data Communication data for support * @var array $nfsalesforcecrm_account_data Objects and Fields available for field mapping * */
- Method
- nfsalesforcecrm_extract_advanced_codes /** * Returns the advanced codes setting field as an array * @return array */
- Method
- nfsalesforcecrm_advanced_code_is_set /** * Checks if given advanced code is set and returns boolean answer * * @param string $needle * @return boolean */
- Method
- nfsalesforcrcrm_output_account_data /** * Create HTML for account data * * @global array $nfsalesforcecrm_settings * @global array $nfsalesforcecrm_account_data * @return type * */
- Method
- nfsalesforcecrm_update_comm_data /** * Update communication data as a nested array for support * * 'debug'=>array( * *class* => array( * array( * 'heading' => string, * 'value' => string * ) * . . . * ) * . . . * ) * 'status'=>array( * (string) * . . . * ) * @param array $comm_data_array * */
- Method
- nfsalesforcecrm_update_account_data
- Method
- nfsalesforcecrm_update_settings
- Method
- nfsalesforcecrm_listener /** * Listens for POST or GET requests with specific commands * * Calls specific functions based on the request made; uses if statements with * a switch/case so that only vetted functions are called instead of allowing * for unvetted function calls */
- Method
- nfsalesforcecrm_refresh_token /** * Attempts to generate refresh token from key, secret, and auth code * * @global array $nfsalesforcecrm_settings Salesforce settings array in db * */
- Method
- nfsalesforcecrm_filter_authcode /** * Adds characters removed by NF settings * @param string $incoming_authcode * @return string Authorization code with trailing %3D added back in */
- Method
- nfsalesforcecrm_build_duplicate_check_task_array /* * Build the Task fields for reviewing the duplicate object, field, and value * found during the duplicate field check * * Currently uses Task Subject and Description */
- Method
- nfsalesforcecrm_extract_upload_contents /** * Gets the contents of an href link * * If unable to retrieve the contents of the link, returns FALSE * * @param string $link Link sent in anchor href format * @return string $contents The contents of the link */
NF_SalesforceCRM_Admin_Settings
-
Method
- __construct public
- Method
- plugin_settings public
- Method
- initiliazeCommData protected
- Retrieves the stored Comm Data and sets default for any missing values Method
- setHTMLMarkup protected
- Sets and marks up the HTML values on the CRM section of settings page Method
- optionDisplaySupport protected
-
Optionally display the support settings
Paramarray $advanced_codes Advanced codes array
Method
- optionHideSetup protected
-
Optionally hide the setup settings
Used to remove the setup settings (to reduce clutter on the page)
Paramarray $advanced_codes Advanced codes array
Method
- plugin_settings_groups public
- Method
- buildAuthURL protected
- Build the Authorization URL Method
- buildAuthorizationCodeMarkup protected
- Used to provide current status of API connection Method
- buildRefreshTokenInstructionsMarkup protected
-
Returnstring HTMl markup of listener link for refresh token generation
Method
- buildStatusMarkup protected
-
Returnstring HTML markup of the status array
Method
- buildRefreshTokenListenerLink protected
-
Builds URL for refresh token listener
Returnstring Listener URL for refresh token Needs to match the URL in nfsalesforcecrm_listener
Method
- buildRefreshObjectsInstructionsMarkup protected
-
Returnstring Markup with link for refreshing object
Method
- buildRefreshObjectsListenerLink protected
-
Builds URL for refresh objects listener
Returnstring Listener URL for objects token Needs to match the URL in nfsalesforcecrm_listener
NF_SalesforceCRM_Admin_Settings
-
Method
- nfsalesforcecrm_build_salesforce_field_list /** * Builds the drop-down list of Salesforce fields that can be mapped to * * Uses the global account_data variable to construct list. Structure is * an index array of 'name'-'value' pairs. The 'name' is reader-friendly, * the 'value' is programmatic * * @global array $nfsalesforcecrm_account_data * @return array * * TODO: refactor this function to eliminate multiple return statements */
NF_SalesforceCRM_Admin_Settings
-
Method
- nfsalesforcecrm_retrieve_api_parameters /** * Uses the user settings to build an array of parameters needed to access * the Salesforce API * * Creates an instance of SalesforceSecurityCredentials to build security credentials * Creates an instance of SalesforceAccessToken from the security credentials * Creates an instance of SalesforceVersion from the access token * * @global array $nfsalesforcecrm_settings * @return array * api_parameter_array * 'result' => * 'status' => * 'access_token' => * 'instance' => * 'version_url' => * */
NF_SalesforceCRM_Admin_Settings
-
Method
- nfsalesforcecrm_refresh_salesforce_objects /* * Process the submitted form to send the data to Salesforce * */
ProcessAddToSalesforce
Handles the Process of the Add to Salesforce Action
-
Method
- __construct public
-
Processes the Add to Salesforce Action upon submission
Paramarray $action_settings Action Settings from form submissionParamstring $form_id Form ID of the submissionParamarray $data Data array of the form submissionParamarray $field_map_array Salesforce fields available for mapping as indexed array of 'name''value' pairsParamarray $fields_to_extract Field mapping keys of submission data to extract
Method
- processForm public
-
Processes the Add To Salesforce action
Returnboolean
Method
- getAuthorization protected
-
Retrieves and sets the API parameter array; false on failure
Updates the CommData status with results
TODO: add detailed failure analysis on failure ex: missing parameters, no internet
Method
- getObjectRequestList protected
- Retrieves the Object Request List, if empty, logs CommData status message Method
- iterateObjectList protected
-
Iterates the array of objects and inserts them into Salesforce
Returnboolean
Method
- logResponses protected
-
Gets raw response and analysis and logs them
Paramstring $object_nameParam\SalesforceCommunication $comm_object
Method
- checkForDuplicates protected
-
Cycle through the duplicate check array and check if the given
Salesforce object and field have more than one of the same user value
If true, create a task with description identifying the object,
field, and value that is duplicated
Method
- analyzeResponse protected
-
Given a raw response, gets analysis and logs into CommData
Paramarray $response Raw response from CommunicationObjectReturnarray Response analysis
Method
- buildMessageArray protected
-
Given an object and the analysis, builds messages with appended support
Paramstring $object Name of Salesforce objectParamarray $analysis Response analysis from SalesforceAnalyzeResponseReturnarray Message array
Method
- updateStatus protected
- Updates status, given an array of messages Method
- appendContextualHelp protected
- Method
- appendStatusMessageArray protected
-
Appends status_message_array with given message array
Paramarray $array Messages to append
Method
- logOrderedRequest protected
-
Given the object name and field array, add it Comm Data ordered request
Paramstring $objectParamarray $field_array
Method
- extractFieldData protected
- Builds the request array from extracted field mapping data Method
- buildFieldMapLookup protected
-
Builds associative array['name'] => 'value' for available field maps
The lookup is keyed on the reader-friendly 'name' to lookup the mapping value
Method
- setRequestObject public
-
Inject the Salesforce Request Object for processing
Paramobject $object
Method
- setCommDataObject public
-
Inject the Communication Data Object for managing comm data
Paramarray $object
Method
- setAnalyzeResponseObject public
-
Inject the AnalyzeResponse Object to analyze and return information
Paramarray $object SalesforceAnalyzeResponse class
Method
- setSupportObject public
-
Inject the Support Object to provide contextual support
Paramarray $object NF_SalesforceCRM_Support class
Method
- getData public
-
Returns the $data from the form submission
Returnarray
Method
- getMessages public
-
Returns Action messages, optionally imploded per formate
plain = plain text line breaks html, screen =
Paramstring $formatReturnmixed
SalesforceAnalyzeResponse
Given a full response, analyze and return pertinent information
-
Method
- analyzeResponse public
- Analyze current response Method
- getData protected
-
On create success, raw data has this structure: a:3:{ s:2:"id";s:18:" { string } "; s:7:"success";b:1; s:6:"errors";a:0:{} }
On Duplicate Check a:3{ s:9:"totalSize";i:_ s:4:"done";b:_ s:7:"records";a:_{} }Returnarray Extracted data
Method
- extractDataErrors protected
-
On failure, raw data has this structure: a:1:{ i:0;a:3:{ s:7:"message";s:39:" { human-readable string } "; s:9:"errorCode";s:22:" { programmatic string }"; s:6:"fields";a:1:{i:0;s:8:" { field-name string } ";} // OPTIONAL } }
On error, extract each error as an element in data[ 'errors' ] If fields is populated, each field will get its own fully formed element with message and errorCode
Paramarray $raw_data Raw data array describing errorsReturnarray Indexed array of errors
Method
- iterateErrorFields protected
-
Splits a single error with multiple fields into individual errors
Each individual error has a string as an error
Paramarray $single_error Single error from raw response dataReturnarray Indexed array of errors
Method
- initVars protected
- Initialize variables for new analysis Method
- setResponse public
-
Sets the incoming response
Paramarray $raw_responseParamstring Context of response, 'create' or 'getrecords'
Method
- getResponseAnalysis public
-
Returns the Analysis of the full response
Returnarray
SalesforceCommData
Manages updates to the communication data log
Retrieves existing db array for starting log; overwrites or appends
new communication data; writes log to db
-
Method
- resetKey public
-
Removes existing data in key and initializes empty array
Paramstring $key
Method
- append public
-
Appends an entry to the indexed array in a given key
Paramstring $key Comm Data key storing the dataParammixed $entry Value to be appended as array element
Method
- set public
-
Replaces existing value with a new value
Paramstring $keyParammixed $entry New value to be stored in key
Method
- initializeCommData public
-
Retrieves existing CommData from db
If incoming value is not an array, sets CommData as empty array
Paramstring $db_key WP options table key storing data
Method
- storeCommData public
-
Stores CommData array in WP options table under given key
Paramstring $db_key WP options table key storing data
SalesforceContextualSupport
Given context, search help configuration and returns contextual help
-
Method
- __construct public
- Method
- searchContext public
-
Searches for context in help configuration and returns array of help text
Context should be set before using this method
Returnarray
Method
- isMatched protected
-
Given an code or message snippet, determines if Contextual Help exists
Paramstring $search_string Portion of string to be matchedReturnboolean
Method
- setAndSearchContext public
-
Sets context and returns contextual help array
Paramarray error Message from response errorReturnarray
Method
- setContext public
-
Set context of what support is needed
A string is given and it is used to search for available help documentation.Paramstring $context
SalesforceSettingsMarkup
Given a key and raw values, adds markup for display on Settings page
-
Static Method
- markup public
- Static Method
- orderedRequest public
- Static Method
- fieldMapArray public
- Static Method
- commDataDebug public
- Static Method
- markupRequestForDisplay public
SalesforceAccessToken
Communication object requesting access token
Expected parameter array on construct:
'credentials_array'=>
'refresh_token'=>,
'consumer_key,
'consumer_secret'=>,
-
Method
- extract_needed_parameters protected
- @inheritDoc Method
- build_response_messages protected
- @inheritDoc Method
- build_final_http_args protected
- @inheritDoc Method
- build_url protected
- @inheritDoc Method
- extract_data_from_response_body protected
- @inheritDoc Method
- get_instance_url public
-
Return the generated instance url
Returnstring|bool
Method
- get_access_token public
-
Return the generated access token
Returnstring|bool
SalesforceRefreshToken
Grabs the client_id, client_secret, and authorization_code from the settings in the options database Returns the refresh token and instance Accessed on the Settings Pages, this class generates the token and instance to be stored in the options database for use during each form submission Receives parameter_array 'client_id' => 'client_secret' => 'authorization_code' => writes the refresh token directly into the options database
-
Method
- extract_needed_parameters protected
- Method
- build_response_messages protected
- Method
- build_url protected
- Method
- build_final_http_args protected
- Method
- extract_data_from_response_body protected
- Method
- get_refresh_token public
SalesforceSecurityCredentials
Given stored settings, extract credentials into known structure
Provides communication data with credentials to provide technical assistance
to the class making the call for credentials
-
Method
- __construct /** * Construct with array of raw credential data * * * @param [type] $nfsalesforcecrm_settings */
- Method
- extract_consumer_key private
-
Extract consumer key and store in credentials property
Returnvoid
Method
- extract_consumer_secret private
-
Extract consumer secret and store in credentials property
Returnvoid
Method
- extract_refresh_token private
-
Extract refresh token and store in credentials property
Returnvoid
Method
- extract_password private
-
Unused method - should be removed
ReturnvoidToDoRemove this unused method
Method
- get_credentials_array public
-
Return credentials array
Returnarray|bool
Method
- get_comm_data public
-
Unused method - should be removed
ReturnvoidToDoRemove this method after verifying disuse
SalesforceVersion
Grabs a list of available verions Sets the version_url to the lates version Receives parameter_array['instance']
-
Method
- extract_needed_parameters protected
- Method
- build_response_messages protected
- Method
- build_url protected
- Method
- build_final_http_args protected
- Method
- extract_data_from_response_body protected
- Method
- get_version_url public
SalesforceBuildRequest
-
Method
- __construct
- Method
- setFieldArray public
- Method
- iterateFieldArray public
- Method
- link_child_objects public
- Method
- build_object_order protected
-
Creates a default array of the order in which objects must be posted
to ensure that the following objects can be linked to the newly
created object's ID
Method
- build_child_object_array protected
-
Creates a default array of parent objects containing an array of
child objects and the field name that links the child to the
parent.
Method
- iterate_nf3_array protected
-
Iterates array structure for NF3 and sends it to process method
Method
- processField protected
- Method
- validateFormValue protected
- Method
- validateDateFormat protected
- Method
- forceBoolean protected
- Method
- keepCharacters protected
-
Remove any html tags but keep the special characters like apostrophe
and ampersand
TODO: determine how to handle this unused method
Method
- validateDateInterval protected
- Method
- validateFileUpload protected
- Method
- formatSalesforceCurrency protected
-
Converts incoming field into Salesforce currency format (integer)
Added February 2018Parammixed $value_inReturninteger
Method
- validate_unprioritized_request_array protected
-
Check if unprioritized request array has any values before proceeding
If not, update comm data and return false to halt processing of form
Method
- reorder_request_array protected
-
Sorts the unprioritized array into order needed for processing
Done by adding the two-digit object order to the front of each
object, sorting on the object key, then removing the object order
Method
- build_object_request_list protected
-
Builds a list of the objects from the prioritized list for iteration
This is done so that after each new record added, the request array
can be modified to insert the newly created object id for linking
Method
- extractObjectAndFieldMap protected
-
Receives a string of the map argument set by the field registration
Explodes the map argument into a salesforce object and a salesforce field
Paramstring $map_argsReturnarray
Method
- get_request_array public
- Method
- get_duplicate_check_array public
- Method
- get_object_request_list public
- Method
- get_object_field_list public
SalesforceCommunication
-
Method
- __construct /** * Constructed with parameter array that is validated by child class * @param array $parameter_array */
- Method
- make_it_so protected
-
Process the communication request
Returnvoid
Method
- extract_needed_parameters protected
- Method
- build_default_http_args private
-
Build the default HTTP args as defined by structure in wp_remote_post
ReturnvoidSince3.1.0
Method
- setSSL private
-
Sets default ssl_verify, applies filters then advanced commands
Default sslverify is true; modifies for nfsalesforcecrm_sslverify filter,
then checks if advanced command 'sslverify_false' is set to change it to
false
ReturnbooleanSince3.1.0
Method
- build_final_http_args protected
- Method
- build_url protected
- Method
- build_response_messages protected
- Method
- retrieve_request private
-
Make the request, set response
Returnvoid
Method
- process_request private
-
Process the raw response data into a known structure
Returnvoid
Method
- process_successful_response_20x protected
-
Structure result when response code is 20x
Returnvoid
Method
- extract_data_from_response_body protected
- Method
- process_bad_request_400 private
-
Structure result when response code is 400
Returnvoid
Method
- extract_body_error_400_messages private
-
Analyze the body of a 400 response to extract errors
Some errors are a single key-value pair while others are
an indexed array of key value pairs. There are also different
keys used for the errors. These must all be handled without
creating an error.
Returnvoid
Method
- process_forbidden_403 private
-
Structure result when response code is 403
Returnvoid
Method
- process_unhandled_response_codes private
-
Structure result when response code is not explicitly defined
Returnvoid
Method
- process_wp_error private
-
Structure result when response is a WP_Error
Returnvoid
Method
- process_failed_parameter_gatekeeper private
-
Structure response when parameter gatekeeper fails
Returnvoid
Method
- get_processed_result_array public
-
Return processed result array
Returnarray|bool
Method
- get_result public
-
Return the processed result 'result' value
'failure' or child-defined value (should be 'success')
Returnvoid
Method
- get_comm_data public
-
Return comm data array
ToDoStandardize comm data as entity object
Returnvoid
Method
- getRawResponse public
-
Returns the Raw Response; false if empty
Returnarray|mixedSince3.1.0
SalesforceDuplicateCheck
checks for a duplicate record by a given field in a given object Receives parameter_array 'instance' => 'version_url' => 'access_token' => 'object_name' => 'field_name' => 'field_value' =>
-
Method
- extract_needed_parameters protected
- Method
- build_response_messages protected
- Method
- build_url protected
- Method
- build_query_string protected
- Method
- build_final_http_args protected
- Method
- extract_data_from_response_body protected
- Method
- get_duplicate_check_response public
SalesforceDescribeObject
Returns the description of a given object Receives parameter_array 'instance' => 'version_url' => 'access_token' => 'object_name' =>
-
Method
- extract_needed_parameters protected
- Method
- build_response_messages protected
- Method
- build_url protected
- Method
- build_final_http_args protected
- Method
- extract_data_from_response_body protected
- Method
- get_object_description public
SalesforceListOfObjects
Builds an indexed array of object names
Receives parameter_array
'instance' =>
'version_url' =>
'access_token' =?
-
Method
- extract_needed_parameters protected
- Method
- build_response_messages protected
- Method
- build_url protected
- Method
- build_final_http_args protected
- Method
- extract_data_from_response_body protected
- Method
- get_list_of_objects public
SalesforcePostNewRecordObject
Posts a new record into the specified object
-
Method
- extract_needed_parameters protected
- Method
- build_response_messages protected
- Method
- build_url protected
- Method
- build_final_http_args protected
- Method
- extract_data_from_response_body protected
- Method
- get_new_record_id public
SimpleEntity
Simple entity abstract upon which all entities are built
Entities are classes that pass well defined data honoring contracts.
Single parameters and arrays, when passed into an entity, can be relied
upon to provide the data defined by the entity, even if the original data
did not fully define values.
-
Method
- toArray public
-
Constructs an array representation of an object
Returns all properties; if properties are not set, then values defined by setter method ensures required values are set. Undefined properties are returned as stored in object. This enables passing of undefined properties, enabling extension of object.
Method
- jsonSerialize public
-
Sets data for json_encode
Returnvoid
Method
- __get public
-
Magic method getter for properties
Paramstring $nameReturnvoid
Method
- __set public
-
Magic method setter for properties
Usually does not support setting undefined properties, but this class is enabling that, although it is kept as a separate command in case it must be modified. This is because field definitions can have an undetermined collection of settings and this class will enable setting of all those values, while maintaining the ability to define sets and gets that filter values for proper types.
Paramstring $nameParammixed $valueReturnVoid
NF_SalesforceCRM
-
Static Method
- instance public
- Method
- __construct public
- Method
- composerAutoloader /** * Load an autoloader from vendor subdirectory * * This function can be copied and reused in other plugins using composer's * PSR-4 specification because it is namespaced within this file to avoid * collision. * * @return boolean */
- Method
- loadTools public
- Instantiates advanced commands object as public property Method
- register_actions public
- Method
- initiateFilters public
- Adds filters for immediate use Ensures filters that are called on page load can have values set Method
- returnConnectiontype public
-
Checks advanced command "sandbox_", returns connection type
Used for connecting to a sandbox version of the site
Paramstring $originalReturnstring
Method
- setup_license public
- Method
- setup_admin public
- Create the settings page Method
- load_classes public
- Static Method
- config public
- Static Method
- file_include public
- Static Method
- template public
- Method
- autoloader public
- Method
- get_nfsalesforcecrm_account_data public
-
Returnarray Array of the Account data
Method
- get_nfsalesforcecrm_comm_data public
-
Returnarray Array of the communication data
Method
- modify_nfsalesforcecrm_comm_data public
-
Modify the comm data global
This doesn't write to the database to minimize db calls. Rather,
use update_nfsalesforcecrm_comm_data to write to the db. If there
is a point where error can halt or branch; run an update to store
the last known data.
Paramstring $key Key of the comm data to updateParamstring $value Value to update in comm dataParambool $append Add to nested array to preserve previous data
Method
- update_nfsalesforcecrm_comm_data public
- Write the current global comm data to the database Method
- NF_SalesforceCRM /** * The main function responsible for returning The Highlander Plugin * Instance to functions everywhere. * * Use this function like you would a global variable, except without needing * to declare the global. * * @since 3.0 * @return {class} Highlander Instance */
- Method
- NF_SalesforceCRM_Upgrade
- Method
- nfsalesforcecrm_build_field_lookup_array /** * * @return array A lookup array keyed on the stored value to replace with the proper label */
SalesforceSettingsMarkupTest
-
Method
- ensureSingleRequestMarkupWithString public
-
Ensures single request markup with string value is constructed properly
Tests that a debug value with a string outputs correctly as a single row with inline style @testReturnvoid
Method
- ensureSingleRequestMarkupWithArray public
-
Ensures single request markup with array value is constructed properly
Tests that an array value for debug is serialized @testReturnvoid
Method
- setUp public
- @inheritDoc
PluginTestCase
-
Method
- setUpUnitTestMockEnvironment public
-
Sets up a mock environment for unit tests
Adds just enough function shims to do unit testing in specific areas.
Unit tests must not rely upon any of the shimmed functions, which are
present only to prevent construction errors from missing function dependencies.
Returnvoid
Method
- defineAbspath protected
-
Set ABSPATH to the Wordpress directory
Returnvoid
Method
- UnitShims protected
-
Include WP shims not handled by Brain Monkey
Returnvoid
Method
- shimNinjaForms protected
-
Shim basic Ninja_Forms() functionality to enable unit testing
Returnvoid
Method
- configureGetOption public
-
Mock get_option and update_option with global array variable
Paramarray $incomingOptionsReturnvoid
Method
- configure public
-
Return a configuration array
Paramstring $configurationNameParamstring $extensionReturnarray
PluginTestCase
-
Method
- add_shortcode <?php
PluginTestCase
-
Method
- esc_html__ <?php
PluginTestCase
-
Method
- get_option
- Method
- update_option
Ninja_Forms
This is a shim for Ninja Forms; it does not function, but it provides the named functionality such that unit tests for classes that call Ninja_Forms() on construct can be instantiated without errors. The unit tests calling this instance MUST NOT use any Ninja_Forms() functionality as the results cannot be trusted. Such integration tests will require an environment in which a true Ninja_Forms() class can operate.
-
Static Method
- instance public
- Method
- form public
-
Form Model Factory Wrapper
Param$idReturnNF_Abstracts_ModelFactory
Method
- logger public
-
Logger Class Wrapper
Example Use: Ninja_Forms()->logger()->log( 'debug', "Hello, {name}!", array( 'name' => 'world' ) ); Ninja_Forms()->logger()->debug( "Hello, {name}!", array( 'name' => 'world' ) );
Returnstring
Method
- dispatcher public
- Method
- eos public
- Method
- session public
- Method
- request public
- Method
- background_process public
- Method
- get_setting public
-
Get a setting
Paramstring $keyParambool|false $defaultReturnbool
Method
- get_settings public
-
Get all the settings
Returnarray
Method
- update_setting public
-
Update a setting
Paramstring $keyParammixed $valueParambool|false $defer_update Defer the database update of all settings
Method
- update_settings public
-
Save settings to database
Paramarray $settings
Static Method
- template public
- Static Method
- config public
- Method
- Ninja_Forms /** * The main function responsible for returning The Highlander Ninja_Forms * Instance to functions everywhere. * * Use this function like you would a global variable, except without needing * to declare the global. * * Example: <?php $nf = Ninja_Forms(); ?> * * @since 2.7 * @return Ninja_Forms Highlander Instance */
Ninja_Forms
-
Method
- plugins_url <?php
- Method
- is_ssl
Ninja_Forms
-
Method
- __
Ninja_Forms
-
Method
- remove_all_filters /** * Remove all of the hooks from a filter. * * @since 2.7.0 * * @global WP_Hook[] $wp_filter Stores all of the filters and actions. * * @param string $tag The filter to remove hooks from. * @param int|false $priority Optional. The priority number to remove. Default false. * @return true True when finished. */
-
The plugin API is located in this file, which allows for creating actions
and filters and hooking functions, and methods. The functions or methods will
then be run when the action or filter is called.
The API callback examples reference functions, but can be methods of classes. To hook methods, you'll need to pass an array one of two ways.
Any of the syntaxes explained in the PHP documentation for the {Linkhttps://www.php.net/manual/en/language.pseudo-types.php#language.types.callback 'callback'} type are valid.
Also see the {Linkhttps://developer.wordpress.org/plugins/ Plugin API} for more information and examples on how to use a lot of these functions.
This file should have no external dependencies.
PackageWordPressSubpackagePluginSince1.5.0
Method
- current_action /** * Retrieve the name of the current action. * * @since 3.9.0 * * @return string Hook name of the current action. */
- Method
- remove_all_actions /** * Remove all of the hooks from an action. * * @since 2.7.0 * * @param string $tag The action to remove hooks from. * @param int|false $priority The priority number to remove them from. Default false. * @return true True when finished. */
- Method
- plugin_basename /** * Gets the basename of a plugin. * * This method extracts the name of a plugin from its filename. * * @since 1.5.0 * * @global array $wp_plugin_paths * * @param string $file The filename of plugin. * @return string The name of a plugin. */
- Method
- wp_register_plugin_realpath /** * Register a plugin's real path. * * This is used in plugin_basename() to resolve symlinked paths. * * @since 3.9.0 * * @see wp_normalize_path() * * @global array $wp_plugin_paths * * @param string $file Known path to the file. * @return bool Whether the path was able to be registered. */
- Method
- plugin_dir_path /** * Get the filesystem directory path (with trailing slash) for the plugin __FILE__ passed in. * * @since 2.8.0 * * @param string $file The filename of the plugin (__FILE__). * @return string the filesystem path of the directory that contains the plugin. */
- Method
- plugin_dir_url /** * Get the URL directory path (with trailing slash) for the plugin __FILE__ passed in. * * @since 2.8.0 * * @param string $file The filename of the plugin (__FILE__). * @return string the URL path of the directory that contains the plugin. */
- Method
- register_activation_hook /** * Set the activation hook for a plugin. * * When a plugin is activated, the action 'activate_PLUGINNAME' hook is * called. In the name of this hook, PLUGINNAME is replaced with the name * of the plugin, including the optional subdirectory. For example, when the * plugin is located in wp-content/plugins/sampleplugin/sample.php, then * the name of this hook will become 'activate_sampleplugin/sample.php'. * * When the plugin consists of only one file and is (as by default) located at * wp-content/plugins/sample.php the name of this hook will be * 'activate_sample.php'. * * @since 2.0.0 * * @param string $file The filename of the plugin including the path. * @param callable $function The function hooked to the 'activate_PLUGIN' action. */
- Method
- register_deactivation_hook /** * Set the deactivation hook for a plugin. * * When a plugin is deactivated, the action 'deactivate_PLUGINNAME' hook is * called. In the name of this hook, PLUGINNAME is replaced with the name * of the plugin, including the optional subdirectory. For example, when the * plugin is located in wp-content/plugins/sampleplugin/sample.php, then * the name of this hook will become 'deactivate_sampleplugin/sample.php'. * * When the plugin consists of only one file and is (as by default) located at * wp-content/plugins/sample.php the name of this hook will be * 'deactivate_sample.php'. * * @since 2.0.0 * * @param string $file The filename of the plugin including the path. * @param callable $function The function hooked to the 'deactivate_PLUGIN' action. */
- Method
- register_uninstall_hook /** * Set the uninstallation hook for a plugin. * * Registers the uninstall hook that will be called when the user clicks on the * uninstall link that calls for the plugin to uninstall itself. The link won't * be active unless the plugin hooks into the action. * * The plugin should not run arbitrary code outside of functions, when * registering the uninstall hook. In order to run using the hook, the plugin * will have to be included, which means that any code laying outside of a * function will be run during the uninstallation process. The plugin should not * hinder the uninstallation process. * * If the plugin can not be written without running code within the plugin, then * the plugin should create a file named 'uninstall.php' in the base plugin * folder. This file will be called, if it exists, during the uninstallation process * bypassing the uninstall hook. The plugin, when using the 'uninstall.php' * should always check for the 'WP_UNINSTALL_PLUGIN' constant, before * executing. * * @since 2.7.0 * * @param string $file Plugin file. * @param callable $callback The callback to run when the hook is called. Must be * a static method or function. */
- Method
- _wp_call_all_hook /** * Call the 'all' hook, which will process the functions hooked into it. * * The 'all' hook passes all of the arguments or parameters that were used for * the hook, which this function was called for. * * This function is used internally for apply_filters(), do_action(), and * do_action_ref_array() and is not meant to be used from outside those * functions. This function does not check for the existence of the all hook, so * it will fail unless the all hook exists prior to this function call. * * @since 2.5.0 * @access private * * @global WP_Hook[] $wp_filter Stores all of the filters and actions. * * @param array $args The collected parameters from the hook that was called. */
- Method
- _wp_filter_build_unique_id /** * Build Unique ID for storage and retrieval. * * The old way to serialize the callback caused issues and this function is the * solution. It works by checking for objects and creating a new property in * the class to keep track of the object and new objects of the same class that * need to be added. * * It also allows for the removal of actions and filters for objects after they * change class properties. It is possible to include the property $wp_filter_id * in your class and set it to "null" or a number to bypass the workaround. * However this will prevent you from adding new classes and any new classes * will overwrite the previous hook by the same class. * * Functions and static method callbacks are just returned as strings and * shouldn't have any speed penalty. * * @link https://core.trac.wordpress.org/ticket/3875 * * @since 2.2.3 * @since 5.3.0 Removed workarounds for spl_object_hash(). * `$tag` and `$priority` are no longer used, * and the function always returns a string. * @access private * * @param string $tag Unused. The name of the filter to build ID for. * @param callable $function The function to generate ID for. * @param int $priority Unused. The order in which the functions * associated with a particular action are executed. * @return string Unique function ID for usage as array key. */
VerifyTestStructureTest
-
Method
- ensureTestSuiteRuns public
- @test Method
- testAutoloader public
- Ensures that autoloader correctly loads non-dev classes @test