Last Updated: Aug. 16, 2022 at 04:03pm UTC
Class

Configure

Provides configured ApiModule-specific entities

Method
__construct public
Instantiate with top-level file directory to provide access throughout
Param
string $dir
Method
globalSettings public
Return ApiModule's configured GlobalSettings entity
Return
GlobalSettings
Method
formFields public
Return ApiModule's configured FormFields entity
Return
FormFields
Method
moduleConfig public
Return module configuration specifying module data requirements
Class

CreateRecordsFormActionHandler

Handle a submitted form's action request to create records in the API account This class is activated for the form action handling process. It is instantiated with the standard fields; shortly after, the custom fields are set by the instantiating plugin. When the form is submitted, the SubmissionData provides the form submission data and this class can match up submission data with the ApiFormFields to make the requests.

Method
__construct public
Instantiate with top level API Module
Param
Hubspot $apiModule
Method
handle public
Make requests to CreateRecords based on SubmissionData instructions
Param
SubmissionDataContract $submissionData
Param
FormContract $form
Method
preHandle protected
Perform platform specific pre-handling required This method provides access to the properties during the handling process such that NF or CF child classes can adjust values as required.
Return
void
Method
postHandle protected
Perform platform specific post-handling required This method provides access to the properties during the handling process such that NF or CF child classes can adjust values as required.
Return
void
Method
extractGlobalSettings protected
Extract required Global Settings from SubmissionData Hubspot does not refresh the API Key so the initial value stored in the SDK at initialization suffices. Hubspot does offer an OAuth integration, which we may at some point need to implement. With this standard method already implemented, we know that we have a method of retrieving dynamic settings from the submission, which OAuth (and possibly other API implementations) require
Method
extractStandardFields protected
Extract standard fields from SubmissionData
Method
extractCustomFields protected
Extract custom fields from SubmissionData
Method
validateValueByFieldType protected
Given raw value and field type, validate value for API compliance
Param
mixed $rawValue
Param
string $fieldType
Return
void
Method
formatDateField protected
Given a raw value, convert it to a UNIX timestamp with microseconds
See
https://salferrarello.com/hubspot-api-call-fail-invalid_date-not-midnight/
Param
mixed $rawValue
Return
integer
Method
setStandardApiFormFields protected
Get the standard ApiFormFields, configured by top level API Module
Method
setCustomApiFormFields public
Set the custom FormFields
Param
FormFields $customApiFormFields
Return
FormActionHandler
Class

Hubspot

Exposes the top-level API of the package

Method
getGlobalSettings public
Return GlobalSettings configured for the ApiModule
May NOT include values, as that must be provided by integrating plugin.
Return
GlobalSettings
Method
setGlobalSettings public
Set GlobalSettings from external source, with values from data source
ApiKey authorization does not need storage capability as OpenAuth does, so we need only the GlobalSettings with values as initiated.
Param
GlobalSettings $globalSettings
Return
HubspotContract
Method
getRemoteRequest public
Return the RemoteRequest
If not explicitly set by external source, default remote request used
Return
RemoteRequestContract
Method
setRemoteRequest public
Set RemoteRequest
Param
RemoteRequestContract $remoteRequest
Return
HubspotContract
Method
getModuleConfig public
Return Module Configuration
Return
array
Method
sdk public
Provide the SDK for communication access to the API
Return
HubspotSdk
Method
getFormFields public
Return standard FormFields configured for the ApiModule
Return
FormFields
Method
getIdentifier public
@inheritDoc
Method
registerServices public
Register the module's services
Return
Module
Class

HubspotSdk

Handles communication to and from the Api This class is constructed by the ApiModule with a RemoteRequest and ApiKey, after which it can be provided to the Integrating Plugin for use.

Method
__construct public
Instantiate the ApiModule SDK
Param
RemoteRequestContract $remoteRequest
Param
string $apiKey
Param
array $moduleConfig
Method
getContactFields public
Return all standard and custom Contact fields
Return
FormFields
Method
getCompanyFields public
Return all standard and custom Contact fields
Return
FormFields
Method
getDealFields public
Return all standard and custom Deal fields
Return
FormFields
Method
getTicketFields public
Return all standard and custom Ticket fields
Return
FormFields
Method
createEntry public
Make request to create entry(ies) from form submission
Param
array $unsortedRequest
Return
array
Method
createModules protected
Iterate unsorted request to make requests to add entries
Param
array $unsortedRequest
Method
createModule protected
Make request to create the given module using the unsorted request data
Param
string $module
Return
HandledResponse|null
Method
extractIds protected
Extract Id of newly created entry with which to construct associations
Param
string $module
Method
buildAssociations protected
Check if two entries have Ids that can be linked; add them to association array
Param
string $associationKey
Return
void
Method
createAssociations protected
Make all associations requests Associations link created entries together
Return
void
Method
getPropertiesRoute protected
Return Properties route
Return
Properties
Method
getContactsRoute protected
Return Contacts route
Return
Contacts
Method
getCompaniesRoute protected
Return Companies route
Return
Companies
Method
getDealsRoute protected
Return Deals route
Return
Deals
Method
getTicketsRoute protected
Return Tickets route
Return
Tickets
Method
getAssociationsRoute protected
Return Associations route
Return
Associations
Method
getIdArray public
Return ID array - collection of Ids of newly created entries
Return
array
Method
getAssociations public
Return associations array of links between newly created entries
Return
array
Class

ApiClient

Method
__construct public
Construct instance that handles API requests

Param
RemoteRequestContract $remoteRequest
Param
String $apiKey
Return
Void
Method
setEndpoint protected
Method
makeRequest protected
Make request to the specified enpoint, returning the handled response
Return
HandledResponse
Method
constructRequestHeader protected
Construct request header
Return
Void
Method
getAccessToken protected
Returns the Access Token
Return
String
Method
hasAccessToken protected
Checks if access token exists
Return
Bool
Class

Associations

Handles requests made to the Associations route of the API Module

Method
setEndpoint protected
Set fully constructed URL for contact related requests
Param
string $endpoint
Return
Void
Method
createAssociation public
Create a batch of associations
Return
HandledResponse
Method
buildBatchBody protected
Build batch body
Param
Array $association
Return
Array
Class

Companies

Handles requests made to the Companies route of the API Module

Method
setEndpoint protected
Set fully constructed URL for contact related requests
Param
String $endpoint
Return
Void
Method
createCompany public
Create new company entry
Param
String $body
Return
HandledResponse
Class

Contacts

Handles requests made to the Contact route of the API Module

Method
setEndpoint protected
Set fully constructed URL for contact related requests
Param
String $endpoint
Return
Void
Method
createContact public
Create new contact entry
Param
String $body
Return
HandledResponse
Class

ConvertFieldPropertiesIntoFormFields

Converts API-structured response body into standardized FormFields

Method
handle public
Converts API-structured response body into standardized FormFields
Param
string $responseBody
Param
string|null $module
Return
type
Method
extractFields protected
Extract field collection into into field definition keyed on field id
Param
string $module
Param
array $fieldsCollection
Method
extractFieldDefinitions protected
Extract field definition into a FormField structure
Param
string $module
Param
string $key
Param
array $fieldDefinitionArray
Method
appendApiFormField protected
Append field definition array into FormFields collection
Param
array $definitions
Method
getFieldType protected
Determine FormField type from FieldType code Lookup values provided only in API specifications; requires manual method to convert into known FormField types
Param
array $fieldDefinitionArray
Return
string
Method
extractCustomFieldArray protected
Extract custom field array from known location inside API response body
Class

Deals

Handles requests made to the Contact route of the API Module

Method
setEndpoint protected
Set fully constructed URL for related requests
Param
String $endpoint
Return
Void
Method
createDeal public
Create new deal entry
Param
String $body
Return
HandledResponse
Class

ExtractAssociationResponse

Extract Association results from HandledResponse

Method
extractResults public
Extract pertinent information provided in the HandledResponse Used extensively for troubleshooting rejections and other failures
Param
HandledResponse $handledResponse
Return
HandledResponse
Method
checkComplete protected
Check if association is successfully completed
Return
bool
Method
extractErrorData protected
Extract error data when error is previously confirmed
Class

ExtractCreateEntryResults

Extract CreateEntry results from HandledResponse

Method
extractResults public
Extracts success response and troubleshooting support data on rejection
Param
HandledResponse $handledResponse
Return
HandledResponse
Method
extractId protected
Extract returned Id If request is accepted, response includes Id of newly created entry
Return
bool True fi Id extracted, false if not extracted
Method
extractBodyMessages protected
Extract body messages, if present, into error messages array
Method
decodeMessage protected
Check for/extract for encoded troubleshooting data within message
Param
string $message
Return
string
Class

Properties

Handles requests made to the Contact route of the API Module

Method
setEndpoint protected
Set fully constructed URL for contact related requests
Param
String $endpoint
Return
Void
Method
getContactProperties public
Get Contact properties (standard and custom field definitions)
Return
HandledResponse
Method
getCompanyProperties public
Get Companies properties (standard and custom field definitions)
Return
HandledResponse
Method
getDealProperties public
Get Deal properties (standard and custom field definitions)
Return
HandledResponse
Method
getTicketProperties public
Get Ticket properties (standard and custom field definitions)
Return
HandledResponse
Class

Tickets

Handles requests made to the Contact route of the API Module

Method
setEndpoint protected
Set fully constructed URL for related requests
Param
String $endpoint
Return
Void
Method
createTicket public
Create new ticket entry
Param
String $body
Return
HandledResponse
Class

AutogenerateForm

Autogenerates a Ninja Form

Method
__construct public
Construct AutogenerateForm
Param
array $actionEntity
Param
FormFields $standardApiFormFields
Param
FormFields $customApiFormFields
Method
handle public
Construct a Ninja Form per set FormFields, Action Configuration, and title
Param
string $listId
Param
string $formTitle
Method
constructApiFields protected
Combine standard- and custom- ApiFormFields into a single collection
Method
constructNinjaFormWithAction public
Construct a new NF form per FormField and ActionConfiguration
Return
void
Method
initializeForm protected
Initialize a new form
Method
setNfFormTitle protected
Set the NF form title
Method
addFormFields protected
Add form fields
Method
addSubmitButton protected
Add submit button to the form
Return
void
Method
addActionFieldMap protected
Add action field map for given field key
Param
string $key
Return
void
Method
addCreateEntryAction protected
Add the action to the form
Method
addSaveAction protected
Add Store Submission (programmatic name: save) to the form
Method
addSuccessMessageAction protected
Add Store Submission (programmatic name: save) to the form
Method
getFormId public
Get the newly created form Id
Return
int
Method
getNinjaForm public
Get the constructed Ninja Form
Return
NF_Abstracts_ModelFactory
Class

ConfigureApiSettings

Construct NF settings configuration from ApiSettings

Method
__construct public
Construct NF settings configuration from ApiSettings
Param
ApiSettings $apiSettings
Method
constructSettingsConfig protected
Iterate ApiSettings to construct NF Settings
Method
selectSettingType protected
Return the correct NF setting field type for the expected data type
Param
string $expectedDataType
Return
string
Method
getSettingsConfig public
Return configured NF settings array
Return
array
Class

ConstructActionEntity

Creates the ActionEntity object from which a NF action can be constructed An ActionEntity object is the complete definition of a Ninja Form action. It defines labels and programmatic slugs used for identification.

Method
__construct public
Param
array $actionConfiguration
Param
GlobalSettingsStorageContract $globalSettingsStorage
Param
FormFields $standardApiFormFields
Param
FormFields $customApiFormFields
Method
convertGlobalSettingsToApiSettings protected
Construct ActionEntity's API settings from the global settings The API's global settings are shared construction between CF and NF. API Settings are specific to NF and is used to construct the plugin settings. GlobalSettings and ApiSettings have similar structures and can be passed straight through. This may not always be the case as other integrations or CF may require additional data or structural changes in the GlobalSettings. This method provides a means to convert the GlobalSetting into the standard NF structure in that scenario.
Method
appendIntegrationSpecificGlobalSettings protected
Add Custom Field and Reauthorization buttons to the GlobalSettings By default, no additional settings are appended. An integrating plugin can extend this class and override this method to customize this behavior.
Method
addActionSettings protected
Construct ActionEntity's Action Settings Action Settings are form-specific settings. For CRM applications, this consists primarily of field mapping.
Method
addStandardApiFormFields protected
Add standard API fields to Action Settings
Method
appendCustomFormFields protected
Appends the injected custom FormFields to the action settings
Method
constructActionSettingFromFormField protected
Create a single field map setting for an ApiFormField
Param
FormField $apiFormField
Return
ActionSettings
Method
determineActionSettingGroup protected
Determine the group location for a given FormField Default group is 'primary'. Integrating plugins can extend and override this method to specify custom action settings group.
Param
FormField $apiFormField
Return
string
Method
createActionSettingsGroups public
Create groupings for the action field mapping Enables large lists of field maps to be organized into manageable groups. Default group is 'primary'. Integrating plugins can extend and override this method to specify custom action settings group.
Method
instantiateActionEntity protected
Initialize an ActionEntity with standard values
Method
getActionEntity public
Get the constructed Action Entity
Return
ActionEntity
Class

ConstructActionSetting

Construct a single action setting

Method
createTextboxFieldMap public
Adds field mapping textbox to action settings
Param
string $name
Param
string $label
Param
string $value
Method
createToggleSetting public
Adds toggle setting to action settings
Param
string $name
Param
string $label
Param
int $value
Class

ConstructActionSettings

Construct collection of action settings

Method
__construct public
Construct collection of action settings
Method
addTextboxFieldMap public
Adds field mapping textbox to action settings
Param
string $name
Param
string $label
Param
string $value
Method
addToggleSetting public
Adds toggle setting to action settings
Param
string $name
Param
string $label
Param
int $value
Method
getActionSettings public

Return
ActionSettings
Class

CreateAddNewModal

Generate markup that constructs a Modal entity for Add New forms

Method
handle public
Construct and return the modal
Return
Modal
Method
constructModalContent protected
Construct full markup from incoming modal content
Incoming modal content does not include markup for button or title input This method adds opening and closing div along with input box for title and button with link to endpoint
Method
addFormTitleInput protected
Append form title input box
Method
generateFormTitleTextbox public
Generate HTML for form title text box
Return
string
Method
closeModalContent protected
Close modal content HTML
Class

GetApiSettingsValues

Get API settings per ApiSettings Entity specification
This is the NF version; could be abstracted with contract when compared with CF

Method
__construct public
Inject ApiSettings entity to retrieve values from Ninja Forms
Param
ApiSettings $apiSettings
Method
getApiSettingsValues public
Get API settings stored in core plugin
Return
array
Class

HandleProcessData

Handle NF Process Data
Heavily based on NF_Stripe_Checkout_FormData

Method
__construct public
Incoming NF Process data
Param
array $data
Param
string $actionKey
Method
addFormError public
Add a form error
Param
string $message
Return
\NFHubspot\EmailCRM\NfBridge\Actions\HandleProcessData
Method
appendResponseData public
Append ResponseData array
Param
array $responseData
Method
toArray public
Return process $data array
Return
array
Class

MarkupResponseDataMetabox

Given HandledResponse entity, adds HTML markup for Diagnostic Metabox This class constructs HTML that outputs a given HandledResponse for display inside a Ninja Forms submission metabox. It only provides the markup for a specific handled response, NOT the entire metabox. It is thus constructed such that multiple responses can be displayed inside a single metabox (which would be required in more complex submissions that make multiple requests for a given form submission)

Method
markupHandledResponse public
Returns metabox markup for given HandledResponse
Param
HandledResponse $handledResponse
Return
string
Method
constructMarkup protected
Constructs markup from Handled Response Wraps context as term, with result, record, and error messages as definitions.
Method
constructContext protected
Construct human-readable context - remove underscores/add capitalization
Method
$str array_map
Method
constructResult protected
Construct human readable result as determined by HandledResponse flags
Method
constructRecord protected
Construct string output for a record id if record id is present
Method
constructErrorMessages protected
Construct error meassages from HandledResponse
Method
initialize protected
initialize values for markup, ensuring known default values
Class

NfAction


Method
__construct public
Constructs NF Action for Registration
Param
ActionEntity $actionEntity
Param
NfActionProcessHandlerContract $processHandler
Param
FormProcessorsFactoryContract $formProcessorsFactory
Param
WpHooksContract $wpHooks
Method
extractParameters protected
Extract action entity to properties
Method
initActionSettings public
Initialize action settings
Method
constructPluginSettings protected
Construct plugins settings for the NF Action
Method
constructPluginSettingsGroup protected
Construct group for the plugin settings
Method
getPluginSettings public
Return NF Action plugin settings
Return
array
Method
getPluginSettingsGroup public
Return NF Action plugin settings group
Return
array
Method
save public
Save
Method
process public
NF method called at form submission
Param
array $actionSettings NF Action settings at form submission
Param
int $formId
Param
array $data NF $data passed at form submission
Return
array
Method
get_timing public
Get Timing
Returns the timing for an action.
Return
mixed
Method
get_priority public
Get Priority
Returns the priority for an action.
Return
int
Method
get_name public
Get Name
Returns the name of an action.
Return
string
Method
get_nicename public
Get Nicename
Returns the nicename of an action.
Return
string
Method
get_section public
Get Section
Returns the drawer section for an action.
Return
string
Method
get_image public
Get Image
Returns the url of a branded action's image.
Return
string
Method
get_settings public
Get Settings
Returns the settings for an action.
Return
array|mixed
Static Method
sort_actions public
Method
loadSettings protected
Loads settings array from FieldSettings config file
Param
array $onlySettings
Return
array
Class

NfNewsletterAction


Method
__construct public
Constructor
Param
ActionEntity $actionEntity
Param
NfActionProcessHandlerContract $processHandler
Param
FormProcessorsFactoryContract $formProcessorsFactory
Param
WpHooksContract $wpHooks
Param
NewsletterExtensionContract $newsletterExtension
Method
extractParameters protected
Extract action entity to properties
Method
initActionSettings public
Initialize action settings
Method
constructPluginSettings protected
Construct plugins settings for the NF Action
Method
constructPluginSettingsGroup protected
Construct group for the plugin settings
Method
getPluginSettings public
Return NF Action plugin settings
Return
array
Method
getPluginSettingsGroup public
Return NF Action plugin settings group
Return
array
Method
save public
Save
Method
process public
NF method called at form submission
Param
array $actionSettings NF Action settings at form submission
Param
int $formId
Param
array $data NF $data passed at form submission
Return
array
Method
get_timing public
Get Timing
Returns the timing for an action.
Return
mixed
Method
get_priority public
Get Priority
Returns the priority for an action.
Return
int
Method
get_name public
Get Name
Returns the name of an action.
Return
string
Method
get_nicename public
Get Nicename
Returns the nicename of an action.
Return
string
Method
get_section public
Get Section
Returns the drawer section for an action.
Return
string
Method
get_image public
Get Image
Returns the url of a branded action's image.
Return
string
Method
get_settings public
Get Settings
Returns the settings for an action.
Return
array|mixed
Static Method
sort_actions public
Method
loadSettings protected
Loads settings array from FieldSettings config file
Param
array $onlySettings
Return
array
Method
getLists public
Retrieve, cache, return via JSON echo list
Method
getListSettings private
Construct list settings for NF Action
Method
cacheLists private
Cache lists
Param
array $lists
Class

NfSettingsGlobalSettingsStorage

Store and retrieve GlobalSettings using Ninja_Forms()->

Method
__construct public
Method
setGlobalSettings public
@inheritDoc
Method
getGlobalSettings public
@inheritDoc
Method
storeGlobalSettings public
@inheritDoc
Method
retrieveGlobalSettings public
@inheritDoc
Method
storeGlobalSetting public
@inheritDoc
Method
retrieveGlobalSetting public
@inheritDoc
Class

OutputResponseDataMetabox

Method
__construct public
Param
string $extraValueKey
Param
string $label
Param
mixed $markupResponseDataMetabox
Method
render_metabox public
Ninja Forms method that outputs metabox
Param
mixed $post
Param
mixed $metabox
Method
extractResponseData protected
Construct collection of ResponseData entities
Method
addNoResponseDataMarkup protected
Add markup for no response data available
Class

RegisterAction

Registers actions added here with Ninja Forms

Method
__construct public
Register NF Actions with Ninja Forms
Param
WPContract
Method
addNfAction public
Add a NF action for registration
Param
NfActionContract $nfAction
Method
registerActions public
Register actions in the Ninja Forms action registry
Param
array $actions
Return
array
Method
registerPluginSettings public
Merge new API settings into settings collection
Param
array $settings
Return
array
Method
registerPluginSettingsGroups public
Merge new action's settings groups into settings groups collection
Param
array $groups
Return
array
Class

RegisterAction

Method
autogenerateModalMarkup public
Provide a Modal entity for Autogenerating a form from the Add New menu
Return
Modal
Method
actionEntity public
Provide ActionEntity defining the primary action of the integrating plugin
Return
ActionEntity
Class

RegisterAction

Method
constructActionSetting public
Provide an object to construct action setting
Method
constructActionSettings public
Provide an object to construct action settings
Class

RegisterAction

Method
fromNinjaForms public
Create form object form Ninja Forms model factory
Param
\NF_Abstracts_ModelFactory $form
Return
Form
Class

RegisterAction

Method
getWpHooks public
Return a WPContract object
Provide access to Wordpress methods or mocked version
Return
WPContract
Method
getSubmissionData public
Create submission data from a NF form submission
Param
array $formActionSubmissionArray
Param
FormActionFieldCollection $actionSettings
Param
ApiSettings $apiSettings
Return
SubmissionDataContract
Method
getConfigureApiSettings public
Construct NF settings configuration from ApiSettings
Param
ApiSettings $apiSettings
Method
getForm public
Return a form contract from a given NF form model factory
Param
NF_Abstracts_ModelFactory $nfFormModelFactory
Return
FormContract
Method
getGetApiSettingsValues public

Param
ApiSettings $apiSettings
Return
getApiSettingsValues
Class

RegisterAction

Method
getLists public
Get a collection of lists
Param
bool $cacheOkay
Return
array
Method
getMergeVars public
Get Merge Vars for a given list id
Param
string $listId
Return
array
Method
getListInterestCategories public
Get Interest Categories for a given list id
Param
string $listId
Return
array
Method
getInterests public
Get Interests for a given list id and interest category id
Param
string $listId
Param
string $interestCategoryId
Class

RegisterAction

Method
save public


Param
array $action_settings
Return
mixed
Method
process public

Param
string $action_id
Param
int $form_id
Param
array$data
Return
mixed
Method
get_timing public
Get Timing
Returns the timing for an action.
Return
int
Method
get_priority public
Get Priority
Returns the priority for an action.
Return
int
Method
get_name public
Get Name
Returns the name of an action.
Return
string
Method
get_nicename public
Get Nicename
Returns the nicename of an action.
Return
string
Method
get_section public
Get Section
Returns the drawer section for an action.
Return
string
Method
get_image public
Get Image
Returns the url of a branded action's image.
Return
string
Method
get_settings public
Get Settings
Returns the settings for an action.
Return
array|mixed
Method
getPluginSettings public
Return NF Action plugin settings
Return
array
Method
getPluginSettingsGroup public
Return NF Action plugin settings group
Return
array
Class

RegisterAction

Method
constructNinjaFormsAction public
Create NfActionContract from our ActionEntity
Param
ActionEntity $actionEntity
Param
NfActionProcessHandlerContract $processHandler
Param
FormProcessorsFactoryContract $formProcessorsFactory
Param
WpHooksApi $wordpress
Return
NfActionContract
Method
constructNinjaFormsNewsletterAction public
Create Newsletter-extended NfActionContract from our ActionEntity
Param
ActionEntity $actionEntity
Param
NfActionProcessHandlerContract $processHandler
Param
FormProcessorsFactoryContract $formProcessorsFactory
Param
WpHooksApi $wordpress
Param
NewsletterExtensionContract $newsletterExtension
Return
NfActionContract
Class

RegisterAction

Method
getPostProcessData public
Return Ninja Forms $data submission after processing
Return
array
Method
extractFormFieldProcessingData public
Extract processing data from form fields to return key-value pairs
Some data required by submission action is contained within form fields. Given the form fields data upon submission, extract the required data to return it as key-value pairs such that it can be added to the submission data and processed
Param
array $data Form field process data
Return
array
Class

RegisterAction

Method
getSubmissionData public
Creates submission data from a NF form submission
Param
array $formActionSubmissionArray
Param
FormActionFieldCollection $actionSettings
Return
SubmissionDataContract
Class

ActionEntity

Entity to construct NF action

Static Method
fromArray public
Method
getName public
Return action name
Return
string
Method
getNicename public
Return action nicename
Return
string
Method
getTags public
Return action tags
Return
string
Method
getTiming public
Return action timing
Return
string
Method
getPriority public
Return action priority
Return
int
Method
getActionSettings public
Return action settings
Return
ActionSettings
Method
getApiSettings public
Return API settings
Return
ApiSettings
Method
setName public
Set action name
Param
string $stringValue
Return
ActionEntity
Method
setNicename public
Set action nice name
Param
string $stringValue
Return
ActionEntity
Method
setTags public
Set action type
Param
array $arrayValue
Return
ActionEntity
Method
setTiming public
Set action timing
Param
string $stringValue
Return
ActionEntity
Method
setPriority public
Set action priority
Param
int $intValue
Return
ActionEntity
Method
setActionSettings public
Set action settings
Param
array $keyedSettingsArray
Return
ActionEntity
Method
setApiSettings public
Set API settings settings
Param
array $keyedSettingsArray
Return
ActionEntity
Class

ActionSetting

Single action setting in form design
Field map connect NF form submission data to a specific location by passing the form submission value keyed on the FormActionField's programmatic name

Static Method
fromArray public
Method
getName public
Return action settings name
Return
string
Method
getType public
Return action settings type
Return
string
Method
getLabel public
Return action settings label
Return
string
Method
getWidth public
Return action settings width
Return
string
Method
getGroup public
Return action settings group
Return
string
Method
getValue public
Return action settings value
Return
string
Method
getHelp public
Return action settings help
Return
string
Method
getOptions public
Return action settings options
Return
Options
Method
getMask public
Return action settings mask
Return
string
Method
getDeps public
Return action settings dependencies
Return
array
Method
getUseMergeTags public
Return action settings useMergeTags
Return
mixed
Method
getSettings public
Return action settings settings
Return
array
Method
getColumns public
Return action settings columns
Return
array
Method
getTmplRow public
Return action settings template row
Return
string
Method
setName public
Set action settings name
Param
string $stringValue
Return
ActionSetting
Method
setType public
Set action settings type
Param
string $stringValue
Return
ActionSetting
Method
setLabel public
Set action settings label
Param
string $stringValue
Return
ActionSetting
Method
setWidth public
Set action settings width
Param
string $stringValue
Return
ActionSetting
Method
setGroup public
Set action settings group
Param
string $stringValue
Return
ActionSetting
Method
setValue public
Set action settings value
Param
string $stringValue
Return
ActionSetting
Method
setHelp public
Set action settings help
Param
string $stringValue
Return
ActionSetting
Method
setOptions public
Set action settings options
Param
Options $options
Return
ActionSetting
Method
setMask public
Set action settings mask
Param
string $stringValue
Return
ActionSetting
Method
setDeps public
Set action settings dependencies
Param
array $arrayValue
Return
ActionSetting
Method
setUseMergeTags public
Set action settings dependencies
Param
mixed $value
Return
ActionSetting
Method
setSettings public
Set action settings settings
Param
array $arrayValue
Return
ActionSetting
Method
setColumns public
Set action settings columns
Param
array $arrayValue
Return
ActionSetting
Method
outputConfiguration public
Return action setting configured for NF Action
Removes unset/null values to enable default NF settings
Return
array
Class

ActionSettings

Describes a collection of NF Bridge Action Settings

Method
__construct public
Static Method
fromArray public
Method
addActionSetting public
Add an Action Setting to collection
Param
ActionSetting $actionSetting
Return
ActionSettings
Method
getActionSetting public
Get an Action Setting from collection
Param
string $name
Return
ActionSetting
Throws
Exception
Method
getActionSettings public
Get all Action Settings in collection
Return
ActionSetting[]
Method
outputConfiguration public
Return action settings configured for NF Action
Removes unset/null values to enable default NF settings
Return
array
Class

ApiSetting

Single API setting in form design
This entity describes a piece of data that the API requires. NF / CF is responsible for storing and delivering this data back to the API.

Static Method
fromArray public
Method
getId public
Return API setting Id
Return
string
Method
getLabel public
Return API setting label
Return
string
Method
getExpectedDataType public
Return API setting data type
Return
string
Method
getValue public
Get the value for the ApiSetting
Return
mixed
Method
setId public
Set API setting Id
Param
string $stringValue
Return
ApiSetting
Method
setLabel public
Set API setting label
Param
string $stringValue
Return
ApiSetting
Method
setExpectedDataType public
Set API setting expected data type
Param
string $stringValue
Return
ApiSetting
Method
setValue public
Set the value for the ApiSetting
Param
mixed|null $param
Return
ApiSetting
Class

ApiSettings

Describes a collection of NF Bridge API Settings

Method
__construct public
Method
getId public
Return API setting Id
Return
string
Method
getLabel public
Return API setting label
Return
string
Method
setId public
Set API setting Id
Param
string $stringValue
Return
ApiSettings
Method
setLabel public
Set API setting label
Param
string $stringValue
Return
ApiSettings
Static Method
fromArray public
Method
toArray public
Convert ApiSettings object into associative array
Return
array
Method
addApiSetting public
Add an API Setting to collection
Param
ApiSetting $apiSetting
Return
ApiSettings
Method
getApiSetting public
Get an API Setting from collection
Param
string $key
Return
ApiSetting
Throws
Exception
Method
getApiSettings public
Get all API Settings in collection
Return
ApiSetting[]
Class

Form

Form object enforcing contract for NF Form object

Method
getName public
Get the name of the form
Return
string
Method
setId public
Method
getId public
Get the id of the form
Return
string
Class

Forms

Collection of NF forms objects

Method
addForm public
Add a form to this collection
Param
FormContract $form
Return
FormCollection
Method
getForm public
Get a form from this collection
Param
string $formId
Return
Form
Throws
Exception
Method
hasForm public
Does collection have a form of this ID?
Param
string $formId
Return
bool
Method
removeForm public
Remove a form from the collection
Param
string $formId
Return
FormCollection
Throws
Exception
Class

Modal

Entity that constructs a Ninja forms modal

Method
setModalContent public
Set modal content
Param
string $content
Return
\NFHubspot\NinjaForms\Mailchimp\Entities\Modal
Method
appendModalContent public
Append modal content
Param
string $content
Return
\NFHubspot\NinjaForms\Mailchimp\Entities\Modal
Method
toArray public
@inheritdoc
Method
getId public
Get modal Id
Return
string
Class

NFBridgeEntity

Class

Option

NF option entity
This entity is used to construct a Ninja Forms option

Method
getLabel public
Return option label
Return
string
Method
getValue public
Return option value
Return
string
Method
setLabel public
Set option label
Param
string $stringValue
Return
Option
Method
setValue public
Set option label
Param
string $stringValue
Return
Option
Class

Options

Collection of option entities

Method
addOption public
Add Option to the collection
Param
Option $option
Return
\NFHubspot\EmailCRM\NfBridge\Entities\options
Method
toArray public
Return option collection as array
Return
array
Static Method
fromArray public
Class

SubmissionData

Represents one form's submission data

Method
getSubmissionKeys public
Return array of action setting keys
Return
array
Method
getKeyedSubmissionData public
Return submission values matching field collection keys
Return
array
Class

Exception

Class

ConstructEntityFactory

Factory to provide actions that construct or configure entities

Method
constructActionSetting public

Return
ConstructActionSetting
Method
constructActionSettings public

Return
ConstructActionSettings
Class

FormFactory

Class FormFactory
Converts Ninja Forms objects to standard Form object

Method
fromNinjaForms public
@inheritdoc
Class

FormProcessorsFactory

Provides classes for NF form processing

Method
__construct public

Param
WpHooksApi $wpHooks
Method
getWpHooks public
@inheritdoc
Method
getSubmissionData public
@inheritDoc
Method
getConfigureApiSettings public
@inheritDoc
Method
getForm public
@inheritdoc
Method
getGetApiSettingsValues public
@inheritdoc
Class

NfActionFactory

Factory for creating an NF Action

Method
constructNinjaFormsAction public
@inheritdoc
Method
constructNinjaFormsNewsletterAction public
@inheritdoc
Class

SubmissionDataFactory

Method
getSubmissionData public
@inheritdoc
Class

NfBridge

Exposes the top-level API of the package

Method
setWpHooks public
Set WpHooks to provide WP action hooks and filters
Param
WpHooksContract $wpHooks
Method
getIdentifier public
@inheritDoc
Method
getContainer public
@inheritDoc
Method
registerServices public
Register the module's services
Return
Module
Class

Class

CachedEndpoint

Method
__construct public
CachedEndpoint constructor.
Param
EndpointContract $proxyEndpoint Endpoint to use for cache misses
Param
ArrayStore $cache Key/value cache store
Method
handleRequest public
Handles request from cache or passes to proxy endpoint
Param
RequestContract $request
Return
ResponseContract
Method
cacheKey protected
Determine cache key
Param
RequestContract $request
Return
string
Method
authorizeRequest public
@inheritDoc
Method
getUri public
@inheritDoc
Method
getArgs public
@inheritDoc
Method
getHttpMethod public
@inheritDoc
Method
setUri public
@inheritDoc
Method
setArgs public
@inheritDoc
Method
setHttpMethod public
@inheritDoc
Method
getToken public
@inheritDoc
Class

CachedEndpoint

Method
authorizeRequest public
Is request authorized or not?
Param
RequestContract $request
Return
bool
Throws
Exception
Class

CachedEndpoint

Method
getUri public
Get route URI
Return
string
Method
getArgs public
Get route arguments
Return
array
Method
getHttpMethod public
Get HTTP method for endpoint
Return
string
Method
setUri public
Param
string $uri
Return
EndpointContract
Method
setArgs public
Param
array $args
Return
EndpointContract
Method
setHttpMethod public
Param
string $httpMethod
Return
HttpContract|EndpointContract
Method
handleRequest public
Handle request
Param
RequestContract $request
Return
ResponseContract
Method
getToken public
Get CSFR/JWT token string from request
Param
RequestContract $request
Return
TokenContract
Class

CachedEndpoint

Method
getGuzzleClient public
Return
GuzzleClientContract
Method
setGuzzleClient public
Param
Client $client
Return
GuzzleClientContract
Class

CachedEndpoint

Method
send public
Send request
Param
Request $request
Param
string $uri
Return
ResponseContract
Class

CachedEndpoint

Method
getParam public
Get parameter from request
Param
string $paramName
Return
mixed
Method
getParams public
Get all params of request
Return
array
Method
setParam public
Set parameter in request
Param
string $paramName
Param
mixed $paramValue
Return
HttpRequestContract
Method
setParams public
Set parameters of request
Param
array $params
Return
HttpRequestContract
Method
hasParam public
Does request have param?
Param
string $paramName
Return
bool
Method
getHeader public
Get header from request
Param
string $headerName
Return
mixed
Method
getHeaders public
Get all headers
Return
array
Method
setHeader public
Set header in request
Param
string $headerName
Param
mixed $headerValue
Return
HttpContract
Method
hasHeader public
Does request have header?
Param
string $headerName
Return
bool
Method
getHttpMethod public
Set the HTTP method for the request or response
Return
string
Method
setHttpMethod public
Set the HTTP method for the request or response
Param
string $method
Return
HttpContract
Method
setHeaders public
Set the request headers
Param
array $headers
Return
HttpContract
Class

CachedEndpoint

Static Method
fromArray public
Method
getData public
Get response data
Return
array
Method
getHeaders public
Get response headers
Return
array
Method
getStatus public
Get the HTTP status code
Return
int
Method
setStatus public
Set the HTTP status code
Param
int $code
Return
HttpResponseContract
Method
setHeaders public
Set the request headers
Param
array $headers
Return
HttpContract
Method
setData public
Set the response body data
Param
array $data
Return
HttpResponseContract
Method
getHttpMethod public
Set the HTTP method for the request or response
Return
string
Method
setHttpMethod public
Set the HTTP method for the request or response
Param
string $method
Return
HttpResponseContract
Class

CachedEndpoint

Method
getToken public
Generate a token, returning its public
Return
string
Method
validateToken public
Test if string is a valid public for a token of current manager
Param
string $tokenStringToValidate
Return
bool
Class

Endpoint

Method
getUri public
@inheritDoc
Method
setUri public
@inheritDoc
Method
getArgs public
@inheritDoc
Method
setArgs public
@inheritDoc
Method
getToken public
@inheritDoc
Class

Exception

Class

Psr7

This factory provides a bridge between the PSR-7 standard for HTTP messages that Guzzle uses, and our system.

Method
fromPsr7Response public
Translate a PSR-7 request to our Response object
Param
ResponseInterface $response
Return
ResponseContract
Method
toPsr7Request public
Translate our response to a PSR-7 response
Param
RequestContract $request
Param
string|null $uri
Return
\GuzzleHttp\Psr7\Request
Class

HttpClient

Guzzle-based HTTP client

Method
__construct public
HttpClient constructor.
Param
Client $guzzle
Param
Psr7 $factory
Method
send public
@inheritDoc
Method
getGuzzleClient public
@inheritDoc
Method
setGuzzleClient public
@inheritDoc
Class

Request

Static Method
fromArray public
Class

Response

Static Method
fromArray public
Method
getData public
@inheritDoc
Method
setData public
@inheritDoc
Method
getStatus public
@inheritDoc
Method
setStatus public
@inheritDoc
Class

Response

Method
constructParameterUri protected
Construct a parameter with REGEX to accept required param/value
Param
string $param Parameter requested
Param
string $mask `numeric` `alphanumeric`
Return
string
Class

Response

Method
getHeader public
Get header from request
Param
string $headerName
Return
string|null
Method
hasHeader public
Param
string $headerName
Return
bool
Method
setHeader public
Set header in request
Param
string $headerName
Param
mixed $headerValue
Return
HttpContract
Method
getHeaders public
@inheritdoc
Method
setHeaders public
Bulk assign headers
Param
array $headers
Return
HttpContract
Class

Response

Method
getHttpMethod public
Set the HTTP method for the request or response
Return
string
Method
setHttpMethod public
Set the HTTP method for the request or response
Param
string $method
Return
HttpContract
Class

Response

Method
getParam public
Get parameter from request
Param
string $paramName
Return
mixed
Method
setParam public
Set parameter in request
Param
string $paramName
Param
mixed $paramValue
Return
$this
Method
hasParam public
Does request have param?
Param
string $paramName
Return
bool
Method
getParams public
Get all params of request
Return
array
Method
setParams public
Set parameters of request
Param
array $params
Return
HttpRequestContract
Class

ApiModuleOpenAuthorizationAbstract

Method
__construct public
Param
OpenAuthImplementationContract $openAuthImplementation
Param
GlobalSettingsStorageContract $globalSettingsStorage
Param
OpenAuthCredentials $openAuthCredentialsLookup
Method
setURLs abstract
Set fully formed endpoints for authorization requests grant_type=authorization_code endpoint grant_type=refresh_token endpoint
Method
initialize protected
Initialize OpenAuth implementation with credentials and endpoint URLs
Method
getGlobalSettings public
Return the GlobalSettings with values In returning the full GlobalSettings, the Integrating Plugin is relieved of the responsibility of knowing the responsibility of managing any specific value.
Return
GlobalSettings
Method
getAccessToken public
Return Access Token
Return
string
Method
authorizeFromAuthorizationToken public
Request authorization using grant_type=authorization_code
Return
ApiModuleOpenAuthorizationContract
Method
authorizeFromRefreshToken public
Request authorization using grant_type=refresh_token
Return
ApiModuleOpenAuthorizationContract
Method
finalize protected
Update credentials and store GlobalSettings Done after authorization request is made, this sets the new credentials in both this instance and requests that the GlobalSettingsStorage class update the data source as well.
Method
extractOpenAuthCredentials protected
Extract credentials from GlobalSettings using OpenAuthCredentials lookup
Method
setNewGlobalSettingsValues protected
Update GlobalSettings with updated OpenAuthCredentials values Refresh token and access token are updated with new values while Authorization Code is reset to an empty string as the code is only good for a single request.
Class

OpenAuthImplementation

Makes OpenAuthorization requests meeting OAuth 2 standards
Requests for authorization following OAuth 2 follows standards that can be shared among all integrating plugins that require that standard. This class
This class structures the requests per the OAuth standard and standardizes the response into a shared handledResponse entity. Each integration must provide the incoming credentials and endpoint URLs with which this class will make the authorization request. The integration must also provide a RemoteRequest object to provide the means with which the requests are sent and received.

Method
__construct public
Construct implementation class with RemoteRequest object for communication
Param
RemoteRequestInterface $remoteRequest
Method
setCredentials public
Set OpenAuth credentials with which to generate authorization
Param
OpenAuthCredentials $openAuthCredentials
Return
OpenAuthenticatorContract
Method
getCredentials public
Return OpenAuthCredentials
The authentication process generates new refresh_ and access_ tokens.
These values are updated in the originally supplied credentials. The requesting class can retrieve the updated credentials, store the refresh token, and use the access token for immediate authorization.
Return
OpenAuthCredentials
Method
setGrantTypeAuthCodeUrl public
Set URL for making grant_type = authorization_code request
Param
string $grantTypeAuthCodeUrl
Return
OpenAuthenticatorContract
Method
setGrantTypeRefreshTokenUrl public
Set URL for making grant_type = refresh_token request
Param
string $grantTypeRefreshTokenUrl
Return
OpenAuthenticatorContract
Method
authorizeFromAuthorizationCode public
Makes a grant_type = Authorization request per OAuth standards
Return
HandledResponse
Method
authorizeFromRefreshToken public
Makes a grant_type = refresh_token request per OAuth standards
Return
HandledResponse
Method
evaluateResponseData protected
Evaluates the response from endpoint to put data in known locations


Note

that the credentials are, per OAuth specification, modified in the making of a authorization request.
An authorization token can only be used once
A refresh token is only used once but, when making an authorization request, a new token is returned along with the access_token that is intended for immediate authorization.
Param
HandledResponse $handledResponse
Return
HandledResponse
Method
constructGrantTypeAuthCodeBody protected
Construct request body per OAuth specifications
Return
array
Method
constructGrantTypeRefreshTokenBody protected
Construct request body per OAuth specifications
Return
array
Method
setRequestSettings protected
Set HTTP settings required for making HTTP request
Class

ArrayLike

Class ArrayLike
Implementation of ArrayAccess for objects we are not ready to type.

Method
__construct public
ArrayLike constructor.
Param
array $items
Method
toArray public
@inheritDoc
Method
offsetSet public
@inheritDoc
Method
offsetExists public
@inheritDoc
Method
offsetUnset public
@inheritDoc
Method
offsetGet public
@inheritDoc
Method
jsonSerialize public
@inheritDoc
Class

CommData

Method
__construct public
Method
initializeCommData public
Retrieves existing CommData from db
If incoming value is not an array, sets CommData as empty array
Method
resetKey public
Removes existing data in key and initializes empty array
Param
string $key
Method
append public
Appends an entry to the indexed array in a given key
Param
string $key Comm Data key storing the data
Param
mixed $entry Value to be appended as array element
Method
set public
Replaces existing value with a new value
Param
string $key
Param
mixed $entry New value to be stored in key
Method
storeCommData public
Stores CommData array in WP options table under given key
Class

ServiceContainer

Basic service container
SEE: docs/container.md

Method
doesProvide public
@inheritdoc
Method
bind public
@inheritdoc
Method
make public
@inheritdoc
Method
isUnBoundSingleton private
Method
singleton public
@inheritdoc
Method
resolve private
Resolve dependencies.
ToDo
use Doctrine Insanitator?
Param
$class
Return
object
Class

ServiceFactoryContainer

Service factory container
This container can be used to group related factories
SEE: docs/container.md

Method
addFactory public
@inheritDoc
Method
useFactory public
@inheritDoc
Method
hasFactory public
@inheritDoc
Class

ServiceFactoryContainer

Method
getGlobalSettings public
Return configured GlobalSettings for the ApiModule
By definition as a 'configured' entity, it does not include any stored values and is standardized across all integrations and implementations
Return
GlobalSettings
Method
getFormFields public
Return configured standard API FormFields for the ApiModule
By definition as a 'configured' entity, it does not include any custom values and is standardized across all integrations and implementations
Return
FormFields
Class

ServiceFactoryContainer

Method
getGlobalSettings public
Return the GlobalSettings with values In returning the full GlobalSettings, the Integrating Plugin is relieved of the responsibility of knowing the responsibility of managing any specific value.
Return
GlobalSettings
Method
getAccessToken public
Get Access Token
Access Token is expected to be generated inside this class.
Return
string
Method
authorizeFromAuthorizationToken public
Request authorization via the authorization_code OpenAuth standard
Return
OpenAuthorizationContract
Method
authorizeFromRefreshToken public
Request authorization via the refresh_token OpenAuth standard
Return
OpenAuthorizationContract
Class

ServiceFactoryContainer

Method
getKey public
The name of the key -- WordPress option name, database identifier, etc. -- used to store data
Return
string
Method
getData public
Get saved data
Return
array
Method
saveData public
Get the saved data
Param
array $data Data to save
Class

ServiceFactoryContainer

Method
toArray public
Convert object to array
Return
array
Class

ServiceFactoryContainer

Method
handle public
Process the data
Param
SubmissionData $submissionData
Param
FormContract $form
Return
mixed
Class

ServiceFactoryContainer

Static Method
getFieldKeys public
Method
getSlug public
Get the processor's slug/ identifier
Return
string
Class

ServiceFactoryContainer

Method
setTitle public
Set the form title
Param
string $title Form Title
Return
\NFHubspot\EmailCRM\Shared\Contracts\FormBuilder
Method
addFormField public
Add form field to the form
Param
FormField $formField
Return
\NFHubspot\EmailCRM\Shared\Contracts\FormBuilder
Method
getTitle public
Get form builder title
Return
string
Method
getFormFields public
Get form fields
Return
FormFields
Method
toArray public
Return FormBuilder entity as associative array
Return
array
Class

ServiceFactoryContainer

Method
addForm public
Param
FormContract $form
Return
FormCollection
Method
getForm public
Get a form from this collection
Param
string $formId
Return
Form
Throws
\Exception
Method
hasForm public
Does collection have a form of this ID?
Param
string $formId
Return
bool
Method
removeForm public
Remove a form from the collection
Param
string $formId
Return
FormCollection
Throws
Exception
Class

ServiceFactoryContainer

Method
getName public
Get the name of the form
Return
string
Method
getId public
Get the id of the form
Return
string
Class

ServiceFactoryContainer

Method
setGlobalSettings public
Method
getGlobalSettings public
Get GlobalSettings from this class, does NOT retrieve from storage location
Return
GlobalSettings
Method
storeGlobalSettings public
Store entire collection of GlobalSettings in a storage location
Return
GlobalSettingsStorageContract
Method
retrieveGlobalSettings public
Retrieve entire collection of GlobalSettings from a storage location
Return
GlobalSettingsStorageContract
Method
storeGlobalSetting public
Store a specified GlobalSetting in a storage location
Param
string $id
Return
GlobalSettingsStorageContract
Method
retrieveGlobalSetting public
Retrieve a global setting from a storage location
Param
string $id
Return
GlobalSettingsStorageContract
Class

ServiceFactoryContainer

Method
registerServices public
Register all services
Return
Module
Method
getIdentifier public
Get a module's identifier
Return
string
Class

ServiceFactoryContainer

Method
setCredentials public
Set OpenAuth credentials with which to generate authorization
Param
OpenAuthCredentials $credentials
Return
OpenAuthenticatorContract
Method
getCredentials public
Return OpenAuthCredentials
The authentication process generates new refresh_ and access_ tokens.
These values are updated in the originally supplied credentials. The requesting class can retrieve the updated credentials, store the refresh token, and use the access token for immediate authorization.
Return
OpenAuthCredentials
Method
setGrantTypeAuthCodeUrl public
Set URL for making grant_type = authorization_code request
Param
string $grantTypeAuthCodeUrl
Return
OpenAuthenticatorContract
Method
setGrantTypeRefreshTokenUrl public
Set URL for making grant_type = refresh_token request
Param
string $grantTypeRefreshTokenUrl
Return
OpenAuthenticatorContract
Method
authorizeFromAuthorizationCode public

Return
HandledResponse
Method
authorizeFromRefreshToken public

Return
HandledResponse
Class

ServiceFactoryContainer

Method
setUrl public
Set HTTP request URL
Param
string $url
Return
\NFHubspot\EmailCRM\WpBridge\Contracts\RemoteRequestContract
Method
setHttpArg public
Set an HTTP argument

Param
string $arg
Param
type $value
Return
\NFHubspot\EmailCRM\WpBridge\Contracts\RemoteRequestContract
Method
addQueryArg public
Add a querystring argument

Param
string $arg
Param
type $value
Return
\NFHubspot\EmailCRM\WpBridge\Contracts\RemoteRequestContract
Method
setBody public
Set HTTP request body
Param
type $body
Return
\NFHubspot\EmailCRM\WpBridge\Contracts\RemoteRequestContract
Method
setHeaderParameter public
Set an HTTP header parameter

Param
type $arg
Param
type $value
Return
\NFHubspot\EmailCRM\WpBridge\Contracts\RemoteRequestContract
Method
handle public
Class

ServiceFactoryContainer

Method
bind public
Bind a service to the container.
Param
string $alias Alias for class
Param
object|\Closure $concrete Concrete class
Method
make public
Request a service from the container.
Param
string $alias Alias for class
Return
object|mixed
Method
singleton public
Bind a singleton instance to the container.
Param
string $alias Alias for class
Param
object $binding Single instance of object to bind
Class

ServiceFactoryContainer

Method
addFactory public
Add a factory to the container
Param
string $service Name of service factory
Param
ServiceFactoryContract $serviceFactory
Return
ServiceFactoryContainerContract
Method
useFactory public
Use a factory from the container
Param
string $service Name of service factory
Param
array $args
Return
mixed
Method
hasFactory public
Does container contain factory?
Param
string $service Name of service factory
Return
bool
Class

ServiceFactoryContainer

Method
handle public
Handle a request for this factory
Param
array $args Arguments for factory
Param
ServiceFactoryContainer $container Container that contains this factory
Return
mixed
Class

ServiceFactoryContainer

Method
getValue public
Get value or default
Param
string $key
Param
null $default
Return
mixed|null
Class

ServiceFactoryContainer

Method
applyFilters public
Apply filters to given property
Param
string $tag
Param
mixed $incoming
Param
int $priority
Param
int $acceptedArgs
Method
addFilter public
Add filter to given tag
Param
string $tag
Param
type $hook
Method
addAction public

Param
string $tag
Param
type $hook
Method
updateOption public
Wrap update_option
Param
string $key
Param
type $data
Class

FormBuilder

Shared form entity that can be transported across bridges

Method
__construct public
Construct a new FormBuilder object
Method
setTitle public
Set form title
Param
string $title
Return
FormBuilder
Method
addFormField public
Add form field to the form builder
Param
FormField $formField
Return
FormBuilder
Method
getTitle public
Get form builder title
Return
string
Method
getFormFields public
Get form fields
Return
FormFields
Method
toArray public
Return FormBuilder entity as associative array
Return
array
Class

FormField

Form field entity shared by CF and NF

Method
setId public
Set the field Id
Param
string $id Field Id
Return
SimpleEntity
Method
setLabel public
Set the field label
Param
string $label Field label
Return
SimpleEntity
Method
setType public
Set the field type
Param
string $type Field type
Return
SimpleEntity
Method
setDefault public
Set the default value
Param
type $default Default value
Return
SimpleEntity
Method
setRequired public
Set Required parameter
Param
bool $required Boolean of `is required?`
Return
SimpleEntity
Method
setDescription public
Set the field description
Param
string $description Field description
Return
SimpleEntity
Method
setCharacterLimit public
Set the character limit for the field
Param
int $limit
Return
SimpleEntity
Method
setOptions public
Set field options
Param
Options $options
Return
SimpleEntity
Method
getId public
Get field id
Return
string
Method
getLabel public
Get field label
Return
string
Method
getType public
Get field type
Return
string
Method
getDefault public
Get field default value
Return
mixed
Method
getRequired public
Get field required boolean
Return
bool
Method
getDescription public
Get field description
Return
string
Method
getOptions public
Get options
Return
Options
Method
getCharacterLimit public
Get character limit for the field; 0 indicates no limit
Return
int
Static Method
fromArray public
Class

FormFields

Collection of form field entities shared by CF and NF

Method
addFormField public
Add a form field the fields collection
Param
FormField $field
Return
\NFHubspot\EmailCRM\Shared\Entities\FormFields
Method
getField public
Get form field specified by Id
Param
string $id Id of field
Return
FormField
Throws
Exception
Method
getFields public
Return collection of all form fields
Return
array
Method
toArray public
Return array of all form fields
Return
array
Static Method
fromArray public
Class

GlobalSetting

Single Global setting in form design
This entity describes a piece of data that the Global requires. NF / CF is responsible for storing and delivering this data back to the Global.

Static Method
fromArray public
Method
getId public
Return Global setting Id
Return
string
Method
getLabel public
Return Global setting label
Return
string
Method
getExpectedDataType public
Return Global setting data type
Return
string
Method
getValue public
Get the value for the GlobalSetting
Return
mixed
Method
setId public
Set Global setting Id
Param
string $stringValue
Return
GlobalSetting
Method
setLabel public
Set Global setting label
Param
string $stringValue
Return
GlobalSetting
Method
setExpectedDataType public
Set Global setting expected data type
Param
string $stringValue
Return
GlobalSetting
Method
setValue public
Set the value for the GlobalSetting
Param
type $param
Return
\NFMailchimp\EmailCRM\Shared\Entities\GlobalSetting
Class

GlobalSettings

Describes a collection of Global Settings
Global settings are shared among all the forms, not form-specific

Method
__construct public
Method
getId public
Return Global setting Id
Return
string
Method
getLabel public
Return Global setting label
Return
string
Method
setId public
Set Global setting Id
Param
string $stringValue
Return
GlobalSettings
Method
setLabel public
Set Global setting label
Param
string $stringValue
Return
GlobalSettings
Static Method
fromArray public
Method
toArray public
Convert GlobalSetting object into associative array
Return
array
Method
addGlobalSetting public
Add an Global Setting to collection
Param
GlobalSetting $globalSetting
Return
GlobalSettings
Method
getGlobalSetting public
Get a Global Setting from collection
Param
string $key
Return
GlobalSetting
Throws
Exception
Method
getGlobalSettings public
Get all Global Settings in collection
Return
GlobalSetting[]
Class

HandledResponse

Provides standardized response for Requests
Enables any source a response to minimally handle the response and pass it on to the requester, which will know how to process it as required

Method
setContext public
Set the context
Param
string $string
Return
\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
getContext public
Get the context
Return
string
Method
setRecordCount public
Set the record count
Param
int $int
Return
\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
getRecordCount public
Get the record count
Return
int
Method
setRecords public
Set the records collection
Param
array $array
Return
\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
appendRecord public
Append a single record to the record collection
Param
string $string
Return
\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
appendRecords public
Append a array of records to the collection
Param
array $array
Return
\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
getRecords public
Get the record collection
Return
array
Method
setTimestamp public
Set the timestamp
Param
int $int
Return
\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
getTimestamp public
Get the timestamp
Return
int
Method
setIsSuccessful public
Set IsSuccessful
Param
bool $bool
Return
\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
isSuccessful public
Get IsSuccessful
Return
bool
Method
setIsWpError public
Set IsWpError
Param
bool $bool
Return
\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
isWpError public
Get IsWpError
Return
bool
Method
setIsApiError public
Set IsApiError
Param
bool $bool
Return
\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
isApiError public
Get IsApiError
Return
bool
Method
setIsException public
Set IsException
Param
bool $bool
Return
\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
isException public
Get IsException
Return
bool
Method
setHasNoData public
Set HasNoData
Param
bool $bool
Return
\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
hasNoData public
Get HasNoData
Return
bool
Method
setErrorCode public
Set ErrorCode
Param
int $int
Return
\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
getErrorCode public
Get ErrorCode
Return
int
Method
setErrorMessages public
Get ErrorMessages
Param
array $array
Return
\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
appendErrorMessage public
Append a single error message to collection
Param
string $string
Return
\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
getErrorMessages public
Get ErrorMessages
Return
array
Method
setResponseBody public
Set ResponseBody
Param
string $string
Return
\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
getResponseBody public
Get ResponseBody
Return
string
Class

OpenAuthCredentials

Entity to accept and provide data for Open Authorization protocol

Method
setClientId public
Set client id
Param
string $clientId
Return
SimpleEntity
Method
getClientId public
Get client id
Return
string
Method
setClientSecret public
Set client secret
Param
string $clientSecret
Return
SimpleEntity
Method
getClientSecret public
Get client secret
Return
string
Method
setAuthorizationCode public
Set authorization code
Param
string|null $authorizationCode
Return
SimpleEntity
Method
getAuthorizationCode public
Get authorization code
Return
string
Method
setRedirectUri public
Set redirect URI
Param
string|null $redirectUri
Return
SimpleEntity
Method
getRedirectUri public
Get redirect URI
Return
string
Method
setRefreshToken public
Set refresh token
Param
string|null $refreshToken
Return
SimpleEntity
Method
getRefreshToken public
Get refresh token
Return
string
Method
setAccessToken public
Set access token
Param
string|null $accesstoken
Return
SimpleEntity
Method
getAccessToken public
Get access token
Return
string
Class

Option

Option entity
This entity is used to construct an option

Method
getLabel public
Return option label
Return
string
Method
getValue public
Return option value
Return
string
Method
setLabel public
Set option label
Param
string $stringValue
Return
Option
Method
setValue public
Set option label
Param
string $stringValue
Return
Option
Class

Options

Collection of option entities

Method
addOption public
Add Option to the collection
Param
Option $option
Return
\NFHubspot\EmailCRM\NfBridge\Entities\options
Method
toArray public
Return option collection as array
Return
array
Static Method
fromArray public
Class

ResponseData

Class ResponseData
Provides standardized data from a response with meta data

Static Method
fromArray public
Method
toArray public
Return array of ResponseData
Return
array
Method
getResponse public
Return Response
Return
string
Method
getMessage public
Return Message
Return
string
Method
getContext public
Return Context
Return
string
Method
getDiagnostics public
Return Diagnostics
Return
string
Method
getType public
Return Type
Return
string
Method
getNote public
Return Note
Return
string
Method
setResponse public
Set Response
Return
SimpleEntity
Method
setMessage public
Set Message
Return
SimpleEntity
Method
setContext public
Set Context
Return
SimpleEntity
Method
setDiagnostics public
Set Diagnostics
Return
SimpleEntity
Method
setType public
Set Type
Return
SimpleEntity
Method
setNote public
Set Note
Return
SimpleEntity
Class

SubmissionData

Class SubmissionData
Represents the details about current submission relevant to the form action/ form processor

Method
__construct public
Method
getValue public
Get value or default
Param
string $key
Param
null $default
Return
mixed|null
Class

ConsolidateHandledResponses

Consolidates collection of HandledResponses into single response Form processing may make multiple requests for a single submission, each of which has its own HandledResponse. This class consolidates the responses into a single response so that downstream operations have a single instance with which to work.

Method
handle public
Consolidate collection of HandledResponses into single HandledResponse
Param
array $handledResponseCollection
Return
HandledResponse
Method
consolidateResponses protected
Consolidate responses into a single response A failure in any boolean counts as a failure; all error messages combined in response order; record counts summed.
Method
ensureValidCollection protected
Ensures incoming value is indexed array of HandledResponses
Return
bool
Method
setInvalidRequestResponse protected
Sets handled response when incoming request is invalid
Class

SimpleEntity

Method
toArray public
@inheritdoc
Static Method
fromArray public
Method
jsonSerialize public
Method
__get public
@inheritdoc
Method
__set public
@inheritdoc
Class

InMemoryArrayStore

Implimentation of ArrayStore that is for testing.

Method
__construct public
Method
getData public
Method
saveData public
@inheritDoc
Method
getKey public
@inheritDoc
Class

InMemoryArrayStore

Static Method
fromArray public
Static Method
unSnake protected
Class

InMemoryArrayStore

Method
toArray public
@inheritdoc
Method
getterName protected
Method
snake protected
Convert camel-cased string to snake case
See
https://stackoverflow.com/a/1993772
Param
string $str
Return
string
Class

InMemoryArrayStore

Method
__get public
Get a single config value
Param
string $name Value name
Return
mixed
Method
__set public
Update a single config value
Param
string $name Value name
Param
mixed $value New value
Return
SimpleEntity
Static Method
fromArray public
Method
jsonSerialize public
@inheritDoc
Method
hasValue public
Can this object supply a value?
Param
string $name Name of the value
Return
bool
Method
toArray public
@inheritDoc
Method
setItems protected
Method
addData public
At item to collection
Param
string $key
Param
$value
Class

InMemoryArrayStore

Method
addFilter public
Provide WP's add_filter() functionality
Param
string $filterName
Param
mixed $incoming
Param
int $priority
Param
int $acceptedArgs
Return
mixed
Method
applyFilters public
Provide WP's apply_filters() functionality
Param
string $filterName
Param
mixed $incoming
Return
mixed
Method
addAction public
Provide WP's add_action functionality
Param
string $tag
Param
array|string|callable $hook
Method
wpNonceField public
Provide WP's wp_nonce_field functionality
Param
int|string $action
Param
string $name
Param
bool $referer
Param
bool $echo
Class

InMemoryArrayStore

Method
updateOption public
Wraps WordPress' update_option()
Param
string $key
Param
array|string|integer $data
Method
getOption public
Wraps WordPress' get_option()
Param
string $key
Return
mixed
Class

InMemoryArrayStore

Method
setWpdb public
Set a new instance of WPDB.
Param
\WPDB $wpdb
Return
$this
Method
getWpdb public
Get current instance of WPDB
Return
\WPDB
Method
getResults public
Sql to query, using WordPress
wpdb::getResults($sql)
Param
string $sql The sql query to get results for
Return
\stdClass[]
Class

OptionsStore

A getter/setter for using options table as key/ value store where value is an array

Method
__construct public
OptionsStore constructor.
Param
string $key The name of the key
Method
getData public
@inheritDoc
Method
getKey public
@inheritDoc
Method
saveData public
@inheritDoc
Class

TransientStore

A getter/setter for using transients as key/ value store where value is an array

Method
__construct public
TransientStore constructor.
Param
string $key The name of the key
Method
getData public
@inheritDoc
Method
getKey public
@inheritDoc
Method
saveData public
@inheritDoc
Class

UseWpdb

Method
__construct public
Method
setWpdb public
@inheritDoc
Method
getWpdb public
@inheritDoc
Method
getResults public
@inheritDoc
Class

WPOptionsApi

Method
updateOption public
@inheritDoc
Method
getOption public
@inheritDoc
Class

MailchimpWpHttpClient

Class MailchimpWpHttpClient
For the Mailchimp API client -- uses WordPress HTTP API

Method
handleRequest public
@inheritdoc
Class

RemoteRequest

Make an HTTP request using wp_remote_request

Method
__construct public
Make an HTTP request to return a response array
Method
setUrl public
Set HTTP request URL
Param
string $url
Return
RemoteRequestContract
Method
setHttpArg public
Set an HTTP argument
Param
string $arg
Param
mixed $value
Return
RemoteRequestContract
Method
addQueryArg public
Set an HTTP argument
Param
string $arg
Param
mixed $value
Return
RemoteRequestContract
Method
setBody public
Set HTTP request body
Param
mixed $body
Return
RemoteRequestContract
Method
setHeaderParameter public
Set an HTTP header parameter
Param
string $arg
Param
mixed $value
Return
RemoteRequestContract
Method
finalizeRequest protected
Method
handle public

Return
HandledResponse
Method
setDefaultHttpArgs protected
Set default arguments
Class

AuthorizeRequestWithWordPressUser

Class AuthorizeRequestWithWordPressUser
WordPress capability-based authorization check for routes

Method
__construct public
AuthorizeRestRequest constructor.
Param
string $capability
Method
authorizeRequest public
Param
RequestContract $request
Return
bool
Class

CreateWordPressEndpoints

Create and endpoint on the WordPress REST API

Method
__construct public
CreateEndpoint constructor.
Param
callable $registrationFunction
Param
string $namespace
Method
registerRouteWithWordPress public
Register an endpoint with WordPress
Param
Endpoint $endpoint
Method
wpArgs public
Create arguments for register_rest_route()
Param
Endpoint $endpoint
Return
array
Method
createCallBack protected
Create the callable function for WordPress to use as the callback for this endpoint
Param
callable $handler
Return
callable
Method
createAuthCallBack protected
Create a callable function WordPress will call to authorize the request
Param
callable $handler
Return
callable
Method
requestFromWp protected
Create instance of request class from a WordPress request
Param
\WP_REST_Request $_request
Return
Request
Class

WpBridge

Exposes the top-level API of the package

Method
getIdentifier public
@inheritDoc
Method
registerServices public
Register the module's services
Return
Module
Class

WpHooksApi

Hook into Wordpress functions to decouple Wordpress from the Monorepo This class provides standardized methods for Wordpress-specific functions. In doing so, the Monorepo can function with or without an actual Wordpress installation. This enables robust, simplified testing along with a code base that can migrate across any platform.

Method
applyFilters public
Provide WP's apply_filters() functionality Checks if Wordpress' native function is available and uses that. If it is not, then the original value is returned as it would if no filter had been added.
Param
string $filterName
Param
mixed $incoming
Return
mixed
Method
addFilter public
Provide WP's add_filter() functionality Checks if Wordpress' native function is available and uses that. If it is not available, no filter is added.
Param
string $filterName
Param
mixed $callback
Param
int $priority
Param
int $accepted_args
Return
mixed
Method
addAction public
Provide WP's add_action functionality Check if Wordpress' native function is available and uses that. If it is not available, no action is added.
Param
string $tag
Param
array|string|callable $hook
Method
wpNonceField public
Provide WP's wp_nonce_field functionality If function exists, sets a variable by Wordpress' wp_nonce_field function. Wordpress' function will automatically echo if that parameter is true, If the function does not exist, this method creates a simulated nonce string and conditionally echoes it. Regardless of $echo conditional, the nonce value is returned
Param
int|string $action
Param
string $name
Param
bool $referer
Param
bool $echo
Method
wpRestUrl public
Return the wp_rest_url parameter
Return
string
Class

WpHooksApi

Method
nf_hubspot_init /** * Load plugin if possible * * @since 3.0.0 */
Method
nf_hubspot_php_nag /** * Callback for admin notice shown when PHP version is not correct. * * @since 3.0.0 */
Class

AdminSettings

Description of AdminSettings

Method
__construct public
Method
adminAjax public
Handle AdminAJAX requests
Return
Void
Method
updateCustomFields protected
Request custom field update, returning results for feedback
Return
String
Method
saveApiKeyOnChange protected
Update Ninja Forms Api Key setting
Return
String
Class

ConstructCreateEntryActionEntity

Creates the ActionEntity object from which a NF action can be constructed

Method
appendIntegrationSpecificGlobalSettings protected
Add Custom Field and Reauthorization buttons to the GlobalSettings
Provides UI interfaces inside NF plugin settings
Return
Void
Method
determineActionSettingGroup protected
Determine the group location for a given FormField
Param
FormField $apiFormField
Return
String
Method
createActionSettingsGroups public
Create groupings for the action field mapping
Enables large lists of field maps to be organized into manageable groups
Param
Array $groups
Return
Array
Class

MetaboxOutput

Method
handle public
Static Method
extractResponses protected
Static Method
addContext protected
Static Method
addResult protected
Static Method
addRecord protected
Class

OAuthConnection


Method
__construct public
Constructor
Return
Void
Method
oauthUpgradeNotice public
Function to notify users who need to upgrade from API Key to oAuth.
Param
Array $notices
Return
Array $notices
Method
oauthReconnectNotice public
Function to notify users who need to reconnect
Param
Array $notices
Return
Array $notices
Method
isOauthRequest public
Checks if current request is oAuth request
Return
Bool
Method
handleOauthRequest public
Handle an oAuth Request
Return
Void
Method
hasAPIKey public
Checks if API Key (old method) exists
Return
Bool
Method
getOption private
Get NF Setting Option
Param
String $key
Return
Mixed
Method
setOption private
Set NF Settings Option
Param
String $key
Param
String $value
Return
Void
Method
saveSettings private
Save settings
Return
Void
Method
getAccessToken public
Return Access Token
Return
String
Method
getRefreshToken protected
Return Refresh Token
Return
String
Method
refreshTokens public
Refresh Tokens
Return
Void
Method
handleApiRefresh protected
Refresh token via API request
Return
Void
Method
saveTokens protected
Save New Tokens
Return
Void
Method
deleteTokens protected
Delete Tokens
Return
Void
Method
isConnected public
Check if we're connected
Return
Bool
Method
isExpired public
Check if current access token is expired
Return
Bool
Method
generate_key public
Generates secret key
Return
String
Method
getKey protected
Get Key
Return
String
Class

OAuthConnection

Method
initRestApi public
Initialize the REST API endpoints
Since
3.2.0
@uses "rest_api_init" hook.
Method
setNfBridge public
Set the NfBridge
Param
NfBridgeContract $nfBridge
Return
NinjaFormsMailchimpContract
Method
getNfBridge public
Get the NfBridge
Return
NfBridgeContract
Method
setApiModule public
Get instance of top level API Module
Return
HubspotContract
Since
3.0.0
Method
getApiModule public
Set instance of top level API Module
Return
HubspotContract
Since
3.0.0
Class

AutogenerateFormEndpoint

Endpoint to handle a form autogenerate request

Method
setAutogenerateForm public
Set the autogenerate form
Param
AutogenerateForm $autogenerateForm
Method
addAuthorizer public
Add an authorizer that ensures source of request is authorized
Param
AuthorizeRequestContract $authorizer
Method
getHttpMethod public
@inheritDoc
Method
getArgs public
@inheritDoc
Method
getUri public
@inheritDoc
Method
authorizeRequest public
Authorize the request
Param
RequestContract $request
Return
bool
Method
handleRequest public
@inheritDoc
Method
constructExceptionResponse protected
Construct exception response from given exception
Param
\Exception $exception
Param
string $context
Return
ResponseContract
Class

Configure

Provides configured Integrating Plugin-specific entities

Method
__construct public
Instantiate with top-level file directory to provide access throughout
Param
string $dir
Method
autogenerateModalMarkup public
Return autogenerate modal markup
Used to construct Add New modal box
Return
Modal
Method
actionEntity public
Provide ActionEntity defining the primary action of the integrating plugin
Return
ActionEntity
Class

NfHubspotCreateRecordsFormActionHandler

Extends the default ApiModule FormActionHandler for NF-specific requirements Extracts data from the NF ->process(...,$data) property needed for processing Returns the handled responses for any downstream processing and post processing

Method
getPostProcessData public
Method
extractFormFieldProcessingData public
Extract processing data from form fields to return key-value pairs
Some data required by submission action is contained within form fields. Given the form fields data upon submission, extract the required data to return it as key-value pairs such that it can be added to the submission data and processed
Param
array $data Form field process data
Return
array
Class

NinjaFormsHubspot

Exposes the top-level API of the Integrating Plugin

Method
registerAutogenerateModal public
Creates modal with Add New form autogeneration button
The modal configuration is provided through the configuration factory. A nonce field is generated at the time of modal construction. The endpoint points to a registered REST API endpoint that will handle the request.
Param
Array $templates
Return
Array
Method
addMetabox public
Add a metabox constructor to the react.js submissions page
Param
Array $metaboxHandlers
Return
Array
Method
registerCreateEntryAction public
Register the CreateEntry action
Custom fields are retrieved from storage, or request via the API Module This collection is injected into BOTH the action entity, which defines the action, AND the FormActionHandler. By coordinating their construction, both the defining action and the action handler have the same set of data and the handler has instructions on every piece of data submitted.
Return
Void
Method
initRestApi public
Initialize the REST API endpoints
Since
3.0.0
@uses "rest_api_init" hook.
Return
Void
Method
updateCustomFields public
Store custom fields as requested and provided by the API Module
Return
FormFields
Method
getCustomApiFormFields public
Return stored Custom API Form fields
Custom API Fields are stored and provided by the Integrating Plugin
In NF, a request is made, usually from the settings page and the data is stored in WP Options.
Return
FormFields
Method
setNfBridge public
Set the NF Bridge to provide NF functionality
Param
NfBridgeContract $nfBridge
Return
NinjaFormsHubspot
Method
getNfBridge public
Return the NF Bridge object
Return
NfBridgeContract
Method
setApiModule public
Set the API Module
Param
ApiModuleContract $apiModule
Return
MainInstanceContract
Method
initializeApiModule protected
Initialize API Module with settings values
Return
Void
Method
maybeRemoveApiKey protected
Modify the global settings within NF to encourage migration to OAuth
If refresh token is present, hide API Key option to prevent going back to that authoriztion. If no API Key is set, hide the option completely to force OAuth usage. If API Key is set, and no refresh token is present, then user has not yet migrated, so disable API key so that value is still present, but locked.
Param
GlobalSettings $incoming
Return
GlobalSettings
Method
removeApiKeyFromGlobalSettings protected
Remove the API key from the global settings to ensure only OAuth is available
Param
GlobalSettings $incoming
Return
GlobalSettings
Method
disableApiKeyInGlobalSettings protected
Disable the API key from the global settings but keep it for use
Param
GlobalSettings $incoming
Return
GlobalSettings
Method
getApiModule public
Return the API Module
Return
ApiModuleContract
Method
registerServices public
Binds instances of classes used by the API Module
The API module can then provide those instances in any injected dependency when requested by calling the make() method with the requested class name
Return
Module
Method
setupAdmin public
Setup Admin
Setup admin classes for Ninja Forms and WordPress.
Return
Void
Method
getIdentifier public
@inheritDoc
Class

TestCase

Method
loadTestData public
Load some test data
Param
string $file
Return
array
Method
loadArrayData public
Load array data returned as array from config file
Param
string $file PHP file name including extension
Return
array
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.
Return
void
Method
defineAbspath protected
Set ABSPATH to the Wordpress directory
Return
void
Method
UnitShims protected
Include WP shims not handled by Brain Monkey
Return
void
Method
shimNinjaForms protected
Shim basic Ninja_Forms() functionality to enable unit testing
Return
void
Method
configureGetOption public
Mock get_option and update_option with global array variable
Param
array $incomingOptions
Return
void
Class

ConfigureTest

Test Configure class delivers configurations as expected

Method
setUp protected
@inheritDoc
Method
testConfigure public
@covers \NFHubspot\Factories\Configure::actionEntity @covers \NFHubspot\Factories\Configure::autogenerateModalMarkup
Class

Class

ConstructCreateEntryActionEntityTest

Method
setUp protected
@inheritDoc
Method
testActionEntityCreation public
Ensure that the entity is created per specifications @covers NFHubspot\Actions\ConstructCreateEntryActionEntity::getActionEntity()
Method
testCreateActionSettingsGroups public
Ensure class constructs the required groupings Expected groupings include standard API modules such that the constructed action entity will provide drop-down groups that simplify the field mapping. If more modules are added as a feature enhancement, this test should be adjusted to include any new modules as groups. @covers NFHubspot\Actions\ConstructCreateEntryActionEntity::createActionSettingsGroups()
Method
constructCreateEntryActionEntity protected
Construct class to be tested
Method
constructProperties protected
Construct properties required for class instantiation
Class

GlobalSettingsStorage

Provides agnostic implementation of GlobalSettingsStorageContract All data is contained within the instantiated class; one must manually set Global Settings values as there is no live data source from which to retrieve data. Perfect for testing.

Method
getGlobalSettings public
Return the stored GlobalSettings
Return
GlobalSettings
Method
setGlobalSettings public
Set the GlobalSettings
Param
GlobalSettings $globalSettings
Return
GlobalSettingsStorageContract
Method
retrieveGlobalSetting public
Return the required contract without a live data source
Param
string $id
Return
GlobalSettingsStorageContract
Method
retrieveGlobalSettings public
Return the required contract without a live data source
Param
string $id
Return
GlobalSettingsStorageContract
Method
storeGlobalSetting public
Return the required contract without a live data source
Param
string $id
Return
GlobalSettingsStorageContract
Method
storeGlobalSettings public
Return the required contract without a live data source
Return
GlobalSettingsStorageContract
Class

NfHubspotCreateRecordsFormActionHandlerTest

Test the NF-specific extension of the Hubspot CreateRecordsFormActionHandler

Method
testGetPostProcessData public
Ensures method provides expected array response Hubspot's FormActionHandler will generate an indexed array of HandledResponse. This NF extension to the base class returns this collection and it must always be an array, even if there are no HandledResponse @covers NFHubspot\Handlers\NfHubspotCreateRecordsFormActionHandler::getPostProcessData
Method
testExtractFormFieldProcessingData public
Ensures method provides expected array response The NF extension is given an array of submission data to extract any additional values required. This is useful for extracting data that is not specifically mapped into the action (a custom opt-in field, for example). In this case, there is no additional data required and the method should return the incoming array exactly as provided. @covers NFHubspot\Handlers\NfHubspotCreateRecordsFormActionHandler::getPostProcessData
Method
setUp /** @inheritDoc */
Class

NinjaFormsHubspotTest

Method
testConstants public
Ensure that required constants are set
Class

UnitTestCase

Class

UnitTestCase

Method
add_shortcode <?php
Class

UnitTestCase

Method
esc_html__ <?php
Class

UnitTestCase

Method
get_option
Method
update_option
Class

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
$id
Return
NF_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' ) );
Return
string
Method
dispatcher public
Method
eos public
Method
session public
Method
request public
Method
background_process public
Method
get_setting public
Get a setting
Param
string $key
Param
bool|false $default
Return
bool
Method
get_settings public
Get all the settings
Return
array
Method
update_setting public
Update a setting
Param
string $key
Param
mixed $value
Param
bool|false $defer_update Defer the database update of all settings
Method
update_settings public
Save settings to database
Param
array $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 */
Class

Ninja_Forms

Method
plugins_url <?php
Method
is_ssl
Class

Ninja_Forms

Method
__
Class

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 {
Link
https://www.php.net/manual/en/language.pseudo-types.php#language.types.callback 'callback'} type are valid.
Also see the {
Link
https://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.
Package
WordPress
Subpackage
Plugin
Since
1.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. */
Class

Ninja_Forms

Method
_manually_load_plugin
Class

Ninja_Forms

Method
__
Class

TestCase

Method
loadTestData public
Load some test data
Param
string $file
Return
array
Method
loadArrayData public
Load array data returned as array from config file
Param
string $file PHP file name including extension
Return
array
Class

CompaniesTest

Test Companies class

Method
setUp protected
@inheritDoc
Method
testCreateCompany public
Ensure that data-less, communication-less class still returns expected data @covers \NFHubspot\EmailCRM\Hubspot\Sdk\Companies::createCompany
Class

Class

ConfigureTest

Test Configure class delivers configurations as expected

Method
setUp protected
@inheritDoc
Method
testConfigure public
Ensures required configuration methods provided @covers \NFHubspot\EmailCRM\Hubspot\Factories\Configure::globalSettings @covers \NFHubspot\EmailCRM\Hubspot\Factories\Configure::formFields @covers \NFHubspot\EmailCRM\Hubspot\Factories\Configure::moduleConfig
Class

Class

ContactsTest

Test Contacts class

Method
setUp protected
@inheritDoc
Method
testCreateContact public
Ensure that data-less, communication-less class still returns expected data @covers \NFHubspot\EmailCRM\Hubspot\Sdk\Contacts::createContact
Class

Class

ConvertFieldPropertiesIntoFormFieldsTest

Test ConvertFieldPropertiesIntoFormFields class

Method
testHandle public
Test that class successfully converts successful and unsuccessful request @covers NFHubspot\EmailCRM\Hubspot\Sdk\ConvertFieldPropertiesIntoFormFields::handle()
Class

Class

CreateRecordsFormActionHandlerTest

Test FormActionHandler functionality

Method
testValidations public
Ensure that validation method returns the correct validated values @test
Return
void
Class

extends

Method
__construct public
Method
exposeValidateValueByFieldType public
Provide external access to method
Param
mixed $rawValue
Param
string $fieldType
Return
void
Method
validateDates public
Ensure date values are constructed correctly when timezone is set
Timestamp uses microseconds, so multiply values by 1000
To account for possible daylight savings time, compare absolute value within one hour (36001000) @test
Return
void
Method
__construct public
Method
testFormatDateField public
Method
validateDatesNoTimezone public
Ensure date values are constructed correctly when no timezone set
Timestamp uses microseconds, so multiply values by 1000
To account for possible daylight savings time, compare absolute value within one hour (36001000) @test
Return
void
Method
__construct public
Method
testFormatDateField public
Method
testHandle public
@covers \NFHubspot\EmailCRM\Hubspot\Factories\Configure::globalSettings @covers \NFHubspot\EmailCRM\Hubspot\Factories\Configure::formFields
Method
mockClass protected
@inheritDoc
Method
getId public
Method
getName public
Class

$this

Class

DealsTest

Test Deals class

Method
setUp protected
@inheritDoc
Method
testCreateContact public
Ensure that data-less, communication-less class still returns expected data @covers \NFHubspot\EmailCRM\Hubspot\Sdk\Deals::createDeal
Class

Class

ExtractAssociatinResponseTest

Test ExtractAssociatinResponse class

Method
testBadRequest public
Test that class successfully converts bad response Test using empty handled response @covers NFHubspot\EmailCRM\Hubspot\Sdk\ExtractAssociatinResponse::extractResults()
Class

Class

ExtractCreateEntryResultsTest

Test ExtractCreateEntryResultsTest class

Method
testBadRequest public
Test that class successfully converts bad response Test using empty handled response @covers NFHubspot\EmailCRM\Hubspot\Sdk\ExtractCreateEntryResultsTest::extractResults()
Class

Class

HubspotSdkTest

Method
setUp public
Set up before each test
Method
testGetApiFields public
Ensure all get
Fields are available and return FormFields entities @covers \NFHubspot\EmailCRM\Hubspot\HubspotSdk::getContactFields @covers \NFHubspot\EmailCRM\Hubspot\HubspotSdk::getCompanyFields @covers \NFHubspot\EmailCRM\Hubspot\HubspotSdk::getDealFields @covers \NFHubspot\EmailCRM\Hubspot\HubspotSdk::getTicketFields
Class

Method
testCreateEntry public
Ensure all valid module requests return HandledResponse with correct context Dummy module added in request to ensure class skips undefined modules; this module must be skipped, not appearing in the response collection such that only valid requests are made through the SDK. @covers \NFHubspot\EmailCRM\Hubspot\HubspotSdk::createEntry
Class

HubspotTest

Method
testConstants public
Ensure that required constants are set @covers \NFHubspot\EmailCRM\Hubspot\Hubspot::IDENTIFIER
Method
testGetGlobalSettings public
Ensure as-configured global settings have required values @covers \NFHubspot\EmailCRM\Hubspot\Hubspot::getGlobalSettings
Method
testSetGlobalSettings public
Ensure class sets global settings correctly with correct return types @covers \NFHubspot\EmailCRM\Hubspot\Hubspot::setGlobalSettings
Class

Class

RemoteRequest

Agnostic implementation of WP Bridge's remote request Skips the wp_remote_request

Method
handle public
Override handle() with empty response after skipping HTTP request
Return
HandledResponse
Method
finalizeRequest protected
Overrides finalizeRequest to skip add_query_args WordPress function
Class

TicketsTest

Test Tickets class

Method
setUp protected
@inheritDoc
Method
testCreateContact public
Ensure that data-less, communication-less class still returns expected data @covers \NFHubspot\EmailCRM\Hubspot\Sdk\Tickets::createTicket
Class

Class

UnitTestCase

Class

UnitTestCase

Method
_manually_load_plugin
Class

UnitTestCase

Method
__
Class

TestCase

Method
loadTestData public
Load some test data
Param
string $file
Return
array
Method
loadArrayData public
Load array data returned as array from config file
Param
string $file PHP file name including extension
Return
array
Class

ConsolidatedHandledResponseTest

Test ConsolidatedHandledResponse class Ensure that a collection of Handled Responses are summarized correctly, appending all error messages, summing record counts.

Method
testBadRequest public
Ensure poorly formed request returns valid response
Class

Method
getCollection protected
Load and return specified sample HandledResponse collection data
Param
type $collectionName
Return
array
Method
constructHandledResponseCollection protected
Construct collection of HandledResponses CRMs make multiple API requests while processing a submission, which are collected as an indexed array of HandledResponses. This method simulates that collection when given a well-formed array.
Param
array $array
Class

UnitTestCase