Configure
Provides configured ApiModule-specific entities
-
Method
- __construct public
-
Instantiate with top-level file directory to provide access throughout
Paramstring $dir
Method
- globalSettings public
-
Return ApiModule's configured GlobalSettings entity
ReturnGlobalSettings
Method
- formFields public
-
Return ApiModule's configured FormFields entity
ReturnFormFields
Method
- moduleConfig public
- Return module configuration specifying module data requirements
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
ParamHubspot $apiModule
Method
- handle public
-
Make requests to CreateRecords based on SubmissionData instructions
ParamSubmissionDataContract $submissionDataParamFormContract $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.
Returnvoid
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.
Returnvoid
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
Parammixed $rawValueParamstring $fieldTypeReturnvoid
Method
- formatDateField protected
-
Given a raw value, convert it to a UNIX timestamp with microseconds
Seehttps://salferrarello.com/hubspot-api-call-fail-invalid_date-not-midnight/Parammixed $rawValueReturninteger
Method
- setStandardApiFormFields protected
- Get the standard ApiFormFields, configured by top level API Module Method
- setCustomApiFormFields public
-
Set the custom FormFields
ParamFormFields $customApiFormFieldsReturnFormActionHandler
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.
ReturnGlobalSettings
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.
ParamGlobalSettings $globalSettings
ReturnHubspotContract
Method
- getRemoteRequest public
-
Return the RemoteRequest
If not explicitly set by external source, default remote request used
ReturnRemoteRequestContract
Method
- setRemoteRequest public
-
Set RemoteRequest
ParamRemoteRequestContract $remoteRequestReturnHubspotContract
Method
- getModuleConfig public
-
Return Module Configuration
Returnarray
Method
- sdk public
-
Provide the SDK for communication access to the API
ReturnHubspotSdk
Method
- getFormFields public
-
Return standard FormFields configured for the ApiModule
ReturnFormFields
Method
- getIdentifier public
- @inheritDoc Method
- registerServices public
-
Register the module's services
ReturnModule
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
ParamRemoteRequestContract $remoteRequestParamstring $apiKeyParamarray $moduleConfig
Method
- getContactFields public
-
Return all standard and custom Contact fields
ReturnFormFields
Method
- getCompanyFields public
-
Return all standard and custom Contact fields
ReturnFormFields
Method
- getDealFields public
-
Return all standard and custom Deal fields
ReturnFormFields
Method
- getTicketFields public
-
Return all standard and custom Ticket fields
ReturnFormFields
Method
- createEntry public
-
Make request to create entry(ies) from form submission
Paramarray $unsortedRequestReturnarray
Method
- createModules protected
-
Iterate unsorted request to make requests to add entries
Paramarray $unsortedRequest
Method
- createModule protected
-
Make request to create the given module using the unsorted request data
Paramstring $moduleReturnHandledResponse|null
Method
- extractIds protected
-
Extract Id of newly created entry with which to construct associations
Paramstring $module
Method
- buildAssociations protected
-
Check if two entries have Ids that can be linked; add them to association array
Paramstring $associationKeyReturnvoid
Method
- createAssociations protected
-
Make all associations requests
Associations link created entries together
Returnvoid
Method
- getPropertiesRoute protected
-
Return Properties route
ReturnProperties
Method
- getContactsRoute protected
-
Return Contacts route
ReturnContacts
Method
- getCompaniesRoute protected
-
Return Companies route
ReturnCompanies
Method
- getDealsRoute protected
-
Return Deals route
ReturnDeals
Method
- getTicketsRoute protected
-
Return Tickets route
ReturnTickets
Method
- getAssociationsRoute protected
-
Return Associations route
ReturnAssociations
Method
- getIdArray public
-
Return ID array - collection of Ids of newly created entries
Returnarray
Method
- getAssociations public
-
Return associations array of links between newly created entries
Returnarray
ApiClient
-
Method
- __construct public
-
Construct instance that handles API requests
ParamRemoteRequestContract $remoteRequestParamString $apiKey
ReturnVoid
Method
- setEndpoint protected
- Method
- makeRequest protected
-
Make request to the specified enpoint, returning the handled response
ReturnHandledResponse
Method
- constructRequestHeader protected
-
Construct request header
ReturnVoid
Method
- getAccessToken protected
-
Returns the Access Token
ReturnString
Method
- hasAccessToken protected
-
Checks if access token exists
ReturnBool
Associations
Handles requests made to the Associations route of the API Module
-
Method
- setEndpoint protected
-
Set fully constructed URL for contact related requests
Paramstring $endpoint
ReturnVoid
Method
- createAssociation public
-
Create a batch of associations
ReturnHandledResponse
Method
- buildBatchBody protected
-
Build batch body
ParamArray $association
ReturnArray
Companies
Handles requests made to the Companies route of the API Module
-
Method
- setEndpoint protected
-
Set fully constructed URL for contact related requests
ParamString $endpoint
ReturnVoid
Method
- createCompany public
-
Create new company entry
ParamString $body
ReturnHandledResponse
Contacts
Handles requests made to the Contact route of the API Module
-
Method
- setEndpoint protected
-
Set fully constructed URL for contact related requests
ParamString $endpoint
ReturnVoid
Method
- createContact public
-
Create new contact entry
ParamString $body
ReturnHandledResponse
ConvertFieldPropertiesIntoFormFields
Converts API-structured response body into standardized FormFields
-
Method
- handle public
-
Converts API-structured response body into standardized FormFields
Paramstring $responseBodyParamstring|null $moduleReturntype
Method
- extractFields protected
-
Extract field collection into into field definition keyed on field id
Paramstring $moduleParamarray $fieldsCollection
Method
- extractFieldDefinitions protected
-
Extract field definition into a FormField structure
Paramstring $moduleParamstring $keyParamarray $fieldDefinitionArray
Method
- appendApiFormField protected
-
Append field definition array into FormFields collection
Paramarray $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
Paramarray $fieldDefinitionArrayReturnstring
Method
- extractCustomFieldArray protected
- Extract custom field array from known location inside API response body
Deals
Handles requests made to the Contact route of the API Module
-
Method
- setEndpoint protected
-
Set fully constructed URL for related requests
ParamString $endpoint
ReturnVoid
Method
- createDeal public
-
Create new deal entry
ParamString $body
ReturnHandledResponse
ExtractAssociationResponse
Extract Association results from HandledResponse
-
Method
- extractResults public
-
Extract pertinent information provided in the HandledResponse
Used extensively for troubleshooting rejections and other failures
ParamHandledResponse $handledResponseReturnHandledResponse
Method
- checkComplete protected
-
Check if association is successfully completed
Returnbool
Method
- extractErrorData protected
- Extract error data when error is previously confirmed
ExtractCreateEntryResults
Extract CreateEntry results from HandledResponse
-
Method
- extractResults public
-
Extracts success response and troubleshooting support data on rejection
ParamHandledResponse $handledResponseReturnHandledResponse
Method
- extractId protected
-
Extract returned Id
If request is accepted, response includes Id of newly created entry
Returnbool 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
Paramstring $messageReturnstring
Properties
Handles requests made to the Contact route of the API Module
-
Method
- setEndpoint protected
-
Set fully constructed URL for contact related requests
ParamString $endpoint
ReturnVoid
Method
- getContactProperties public
-
Get Contact properties (standard and custom field definitions)
ReturnHandledResponse
Method
- getCompanyProperties public
-
Get Companies properties (standard and custom field definitions)
ReturnHandledResponse
Method
- getDealProperties public
-
Get Deal properties (standard and custom field definitions)
ReturnHandledResponse
Method
- getTicketProperties public
-
Get Ticket properties (standard and custom field definitions)
ReturnHandledResponse
Tickets
Handles requests made to the Contact route of the API Module
-
Method
- setEndpoint protected
-
Set fully constructed URL for related requests
ParamString $endpoint
ReturnVoid
Method
- createTicket public
-
Create new ticket entry
ParamString $body
ReturnHandledResponse
AutogenerateForm
Autogenerates a Ninja Form
-
Method
- __construct public
-
Construct AutogenerateForm
Paramarray $actionEntityParamFormFields $standardApiFormFieldsParamFormFields $customApiFormFields
Method
- handle public
-
Construct a Ninja Form per set FormFields, Action Configuration, and title
Paramstring $listIdParamstring $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
Returnvoid
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
Returnvoid
Method
- addActionFieldMap protected
-
Add action field map for given field key
Paramstring $keyReturnvoid
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
Returnint
Method
- getNinjaForm public
-
Get the constructed Ninja Form
ReturnNF_Abstracts_ModelFactory
ConfigureApiSettings
Construct NF settings configuration from ApiSettings
-
Method
- __construct public
-
Construct NF settings configuration from ApiSettings
ParamApiSettings $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
Paramstring $expectedDataTypeReturnstring
Method
- getSettingsConfig public
-
Return configured NF settings array
Returnarray
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
-
Paramarray $actionConfigurationParamGlobalSettingsStorageContract $globalSettingsStorageParamFormFields $standardApiFormFieldsParamFormFields $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
ParamFormField $apiFormFieldReturnActionSettings
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.
ParamFormField $apiFormFieldReturnstring
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
ReturnActionEntity
ConstructActionSetting
Construct a single action setting
-
Method
- createTextboxFieldMap public
-
Adds field mapping textbox to action settings
Paramstring $nameParamstring $labelParamstring $value
Method
- createToggleSetting public
-
Adds toggle setting to action settings
Paramstring $nameParamstring $labelParamint $value
ConstructActionSettings
Construct collection of action settings
-
Method
- __construct public
- Construct collection of action settings Method
- addTextboxFieldMap public
-
Adds field mapping textbox to action settings
Paramstring $nameParamstring $labelParamstring $value
Method
- addToggleSetting public
-
Adds toggle setting to action settings
Paramstring $nameParamstring $labelParamint $value
Method
- getActionSettings public
-
ReturnActionSettings
CreateAddNewModal
Generate markup that constructs a Modal entity for Add New forms
-
Method
- handle public
-
Construct and return the modal
ReturnModal
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
Returnstring
Method
- closeModalContent protected
- Close modal content HTML
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
ParamApiSettings $apiSettings
Method
- getApiSettingsValues public
-
Get API settings stored in core plugin
Returnarray
HandleProcessData
Handle NF Process Data
Heavily based on NF_Stripe_Checkout_FormData
-
Method
- __construct public
-
Incoming NF Process data
Paramarray $dataParamstring $actionKey
Method
- addFormError public
-
Add a form error
Paramstring $messageReturn\NFHubspot\EmailCRM\NfBridge\Actions\HandleProcessData
Method
- appendResponseData public
-
Append ResponseData array
Paramarray $responseData
Method
- toArray public
-
Return process $data array
Returnarray
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
ParamHandledResponse $handledResponseReturnstring
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
NfAction
-
Method
- __construct public
-
Constructs NF Action for Registration
ParamActionEntity $actionEntityParamNfActionProcessHandlerContract $processHandlerParamFormProcessorsFactoryContract $formProcessorsFactoryParamWpHooksContract $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
Returnarray
Method
- getPluginSettingsGroup public
-
Return NF Action plugin settings group
Returnarray
Method
- save public
- Save Method
- process public
-
NF method called at form submission
Paramarray $actionSettings NF Action settings at form submissionParamint $formIdParamarray $data NF $data passed at form submissionReturnarray
Method
- get_timing public
-
Get Timing
Returns the timing for an action.
Returnmixed
Method
- get_priority public
-
Get Priority
Returns the priority for an action.
Returnint
Method
- get_name public
-
Get Name
Returns the name of an action.
Returnstring
Method
- get_nicename public
-
Get Nicename
Returns the nicename of an action.
Returnstring
Method
- get_section public
-
Get Section
Returns the drawer section for an action.
Returnstring
Method
- get_image public
-
Get Image
Returns the url of a branded action's image.
Returnstring
Method
- get_settings public
-
Get Settings
Returns the settings for an action.
Returnarray|mixed
Static Method
- sort_actions public
- Method
- loadSettings protected
-
Loads settings array from FieldSettings config file
Paramarray $onlySettingsReturnarray
NfNewsletterAction
-
Method
- __construct public
-
Constructor
ParamActionEntity $actionEntityParamNfActionProcessHandlerContract $processHandlerParamFormProcessorsFactoryContract $formProcessorsFactoryParamWpHooksContract $wpHooksParamNewsletterExtensionContract $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
Returnarray
Method
- getPluginSettingsGroup public
-
Return NF Action plugin settings group
Returnarray
Method
- save public
- Save Method
- process public
-
NF method called at form submission
Paramarray $actionSettings NF Action settings at form submissionParamint $formIdParamarray $data NF $data passed at form submissionReturnarray
Method
- get_timing public
-
Get Timing
Returns the timing for an action.
Returnmixed
Method
- get_priority public
-
Get Priority
Returns the priority for an action.
Returnint
Method
- get_name public
-
Get Name
Returns the name of an action.
Returnstring
Method
- get_nicename public
-
Get Nicename
Returns the nicename of an action.
Returnstring
Method
- get_section public
-
Get Section
Returns the drawer section for an action.
Returnstring
Method
- get_image public
-
Get Image
Returns the url of a branded action's image.
Returnstring
Method
- get_settings public
-
Get Settings
Returns the settings for an action.
Returnarray|mixed
Static Method
- sort_actions public
- Method
- loadSettings protected
-
Loads settings array from FieldSettings config file
Paramarray $onlySettingsReturnarray
Method
- getLists public
- Retrieve, cache, return via JSON echo list Method
- getListSettings private
- Construct list settings for NF Action Method
- cacheLists private
-
Cache lists
Paramarray $lists
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
OutputResponseDataMetabox
-
Method
- __construct public
-
Paramstring $extraValueKeyParamstring $labelParammixed $markupResponseDataMetabox
Method
- render_metabox public
-
Ninja Forms method that outputs metabox
Parammixed $postParammixed $metabox
Method
- extractResponseData protected
- Construct collection of ResponseData entities Method
- addNoResponseDataMarkup protected
- Add markup for no response data available
RegisterAction
Registers actions added here with Ninja Forms
-
Method
- __construct public
-
Register NF Actions with Ninja Forms
ParamWPContract
Method
- addNfAction public
-
Add a NF action for registration
ParamNfActionContract $nfAction
Method
- registerActions public
-
Register actions in the Ninja Forms action registry
Paramarray $actionsReturnarray
Method
- registerPluginSettings public
-
Merge new API settings into settings collection
Paramarray $settingsReturnarray
Method
- registerPluginSettingsGroups public
-
Merge new action's settings groups into settings groups collection
Paramarray $groupsReturnarray
RegisterAction
-
Method
- autogenerateModalMarkup public
-
Provide a Modal entity for Autogenerating a form from the Add New menu
ReturnModal
Method
- actionEntity public
-
Provide ActionEntity defining the primary action of the integrating plugin
ReturnActionEntity
RegisterAction
-
Method
- constructActionSetting public
- Provide an object to construct action setting Method
- constructActionSettings public
- Provide an object to construct action settings
RegisterAction
-
Method
- fromNinjaForms public
-
Create form object form Ninja Forms model factory
Param\NF_Abstracts_ModelFactory $formReturnForm
RegisterAction
-
Method
- getWpHooks public
-
Return a WPContract object
Provide access to Wordpress methods or mocked versionReturnWPContract
Method
- getSubmissionData public
-
Create submission data from a NF form submission
Paramarray $formActionSubmissionArrayParamFormActionFieldCollection $actionSettingsParamApiSettings $apiSettingsReturnSubmissionDataContract
Method
- getConfigureApiSettings public
-
Construct NF settings configuration from ApiSettings
ParamApiSettings $apiSettings
Method
- getForm public
-
Return a form contract from a given NF form model factory
ParamNF_Abstracts_ModelFactory $nfFormModelFactoryReturnFormContract
Method
- getGetApiSettingsValues public
-
ParamApiSettings $apiSettingsReturngetApiSettingsValues
RegisterAction
-
Method
- getLists public
-
Get a collection of lists
Parambool $cacheOkayReturnarray
Method
- getMergeVars public
-
Get Merge Vars for a given list id
Paramstring $listIdReturnarray
Method
- getListInterestCategories public
-
Get Interest Categories for a given list id
Paramstring $listIdReturnarray
Method
- getInterests public
-
Get Interests for a given list id and interest category id
Paramstring $listIdParamstring $interestCategoryId
RegisterAction
-
Method
- save public
-
Paramarray $action_settingsReturnmixed
Method
- process public
-
Paramstring $action_idParamint $form_idParamarray$dataReturnmixed
Method
- get_timing public
-
Get Timing
Returns the timing for an action.
Returnint
Method
- get_priority public
-
Get Priority
Returns the priority for an action.
Returnint
Method
- get_name public
-
Get Name
Returns the name of an action.
Returnstring
Method
- get_nicename public
-
Get Nicename
Returns the nicename of an action.
Returnstring
Method
- get_section public
-
Get Section
Returns the drawer section for an action.
Returnstring
Method
- get_image public
-
Get Image
Returns the url of a branded action's image.
Returnstring
Method
- get_settings public
-
Get Settings
Returns the settings for an action.
Returnarray|mixed
Method
- getPluginSettings public
-
Return NF Action plugin settings
Returnarray
Method
- getPluginSettingsGroup public
-
Return NF Action plugin settings group
Returnarray
RegisterAction
-
Method
- constructNinjaFormsAction public
-
Create NfActionContract from our ActionEntity
ParamActionEntity $actionEntityParamNfActionProcessHandlerContract $processHandlerParamFormProcessorsFactoryContract $formProcessorsFactoryParamWpHooksApi $wordpressReturnNfActionContract
Method
- constructNinjaFormsNewsletterAction public
-
Create Newsletter-extended NfActionContract from our ActionEntity
ParamActionEntity $actionEntityParamNfActionProcessHandlerContract $processHandlerParamFormProcessorsFactoryContract $formProcessorsFactoryParamWpHooksApi $wordpressParamNewsletterExtensionContract $newsletterExtensionReturnNfActionContract
RegisterAction
-
Method
- getPostProcessData public
-
Return Ninja Forms $data submission after processing
Returnarray
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 processedParamarray $data Form field process dataReturnarray
RegisterAction
-
Method
- getSubmissionData public
-
Creates submission data from a NF form submission
Paramarray $formActionSubmissionArrayParamFormActionFieldCollection $actionSettingsReturnSubmissionDataContract
ActionEntity
Entity to construct NF action
-
Static Method
- fromArray public
- Method
- getName public
-
Return action name
Returnstring
Method
- getNicename public
-
Return action nicename
Returnstring
Method
- getTags public
-
Return action tags
Returnstring
Method
- getTiming public
-
Return action timing
Returnstring
Method
- getPriority public
-
Return action priority
Returnint
Method
- getActionSettings public
-
Return action settings
ReturnActionSettings
Method
- getApiSettings public
-
Return API settings
ReturnApiSettings
Method
- setName public
-
Set action name
Paramstring $stringValueReturnActionEntity
Method
- setNicename public
-
Set action nice name
Paramstring $stringValueReturnActionEntity
Method
- setTags public
-
Set action type
Paramarray $arrayValueReturnActionEntity
Method
- setTiming public
-
Set action timing
Paramstring $stringValueReturnActionEntity
Method
- setPriority public
-
Set action priority
Paramint $intValueReturnActionEntity
Method
- setActionSettings public
-
Set action settings
Paramarray $keyedSettingsArrayReturnActionEntity
Method
- setApiSettings public
-
Set API settings settings
Paramarray $keyedSettingsArrayReturnActionEntity
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
Returnstring
Method
- getType public
-
Return action settings type
Returnstring
Method
- getLabel public
-
Return action settings label
Returnstring
Method
- getWidth public
-
Return action settings width
Returnstring
Method
- getGroup public
-
Return action settings group
Returnstring
Method
- getValue public
-
Return action settings value
Returnstring
Method
- getHelp public
-
Return action settings help
Returnstring
Method
- getOptions public
-
Return action settings options
ReturnOptions
Method
- getMask public
-
Return action settings mask
Returnstring
Method
- getDeps public
-
Return action settings dependencies
Returnarray
Method
- getUseMergeTags public
-
Return action settings useMergeTags
Returnmixed
Method
- getSettings public
-
Return action settings settings
Returnarray
Method
- getColumns public
-
Return action settings columns
Returnarray
Method
- getTmplRow public
-
Return action settings template row
Returnstring
Method
- setName public
-
Set action settings name
Paramstring $stringValueReturnActionSetting
Method
- setType public
-
Set action settings type
Paramstring $stringValueReturnActionSetting
Method
- setLabel public
-
Set action settings label
Paramstring $stringValueReturnActionSetting
Method
- setWidth public
-
Set action settings width
Paramstring $stringValueReturnActionSetting
Method
- setGroup public
-
Set action settings group
Paramstring $stringValueReturnActionSetting
Method
- setValue public
-
Set action settings value
Paramstring $stringValueReturnActionSetting
Method
- setHelp public
-
Set action settings help
Paramstring $stringValueReturnActionSetting
Method
- setOptions public
-
Set action settings options
ParamOptions $optionsReturnActionSetting
Method
- setMask public
-
Set action settings mask
Paramstring $stringValueReturnActionSetting
Method
- setDeps public
-
Set action settings dependencies
Paramarray $arrayValueReturnActionSetting
Method
- setUseMergeTags public
-
Set action settings dependencies
Parammixed $valueReturnActionSetting
Method
- setSettings public
-
Set action settings settings
Paramarray $arrayValueReturnActionSetting
Method
- setColumns public
-
Set action settings columns
Paramarray $arrayValueReturnActionSetting
Method
- outputConfiguration public
-
Return action setting configured for NF Action
Removes unset/null values to enable default NF settingsReturnarray
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
ParamActionSetting $actionSetting
ReturnActionSettings
Method
- getActionSetting public
-
Get an Action Setting from collection
Paramstring $name
ReturnActionSettingThrowsException
Method
- getActionSettings public
-
Get all Action Settings in collection
ReturnActionSetting[]
Method
- outputConfiguration public
-
Return action settings configured for NF Action
Removes unset/null values to enable default NF settingsReturnarray
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
Returnstring
Method
- getLabel public
-
Return API setting label
Returnstring
Method
- getExpectedDataType public
-
Return API setting data type
Returnstring
Method
- getValue public
-
Get the value for the ApiSetting
Returnmixed
Method
- setId public
-
Set API setting Id
Paramstring $stringValueReturnApiSetting
Method
- setLabel public
-
Set API setting label
Paramstring $stringValueReturnApiSetting
Method
- setExpectedDataType public
-
Set API setting expected data type
Paramstring $stringValueReturnApiSetting
Method
- setValue public
-
Set the value for the ApiSetting
Parammixed|null $paramReturnApiSetting
ApiSettings
Describes a collection of NF Bridge API Settings
-
Method
- __construct public
- Method
- getId public
-
Return API setting Id
Returnstring
Method
- getLabel public
-
Return API setting label
Returnstring
Method
- setId public
-
Set API setting Id
Paramstring $stringValueReturnApiSettings
Method
- setLabel public
-
Set API setting label
Paramstring $stringValueReturnApiSettings
Static Method
- fromArray public
- Method
- toArray public
-
Convert ApiSettings object into associative array
Returnarray
Method
- addApiSetting public
-
Add an API Setting to collection
ParamApiSetting $apiSetting
ReturnApiSettings
Method
- getApiSetting public
-
Get an API Setting from collection
Paramstring $key
ReturnApiSettingThrowsException
Method
- getApiSettings public
-
Get all API Settings in collection
ReturnApiSetting[]
Form
Form object enforcing contract for NF Form object
-
Method
- getName public
-
Get the name of the form
Returnstring
Method
- setId public
- Method
- getId public
-
Get the id of the form
Returnstring
Forms
Collection of NF forms objects
-
Method
- addForm public
-
Add a form to this collection
ParamFormContract $formReturnFormCollection
Method
- getForm public
-
Get a form from this collection
Paramstring $formIdReturnFormThrowsException
Method
- hasForm public
-
Does collection have a form of this ID?
Paramstring $formIdReturnbool
Method
- removeForm public
-
Remove a form from the collection
Paramstring $formIdReturnFormCollectionThrowsException
Modal
Entity that constructs a Ninja forms modal
-
Method
- setModalContent public
-
Set modal content
Paramstring $contentReturn\NFHubspot\NinjaForms\Mailchimp\Entities\Modal
Method
- appendModalContent public
-
Append modal content
Paramstring $contentReturn\NFHubspot\NinjaForms\Mailchimp\Entities\Modal
Method
- toArray public
- @inheritdoc Method
- getId public
-
Get modal Id
Returnstring
NFBridgeEntity
Option
NF option entity
This entity is used to construct a Ninja Forms option
-
Method
- getLabel public
-
Return option label
Returnstring
Method
- getValue public
-
Return option value
Returnstring
Method
- setLabel public
-
Set option label
Paramstring $stringValueReturnOption
Method
- setValue public
-
Set option label
Paramstring $stringValueReturnOption
Options
Collection of option entities
-
Method
- addOption public
-
Add Option to the collection
ParamOption $optionReturn\NFHubspot\EmailCRM\NfBridge\Entities\options
Method
- toArray public
-
Return option collection as array
Returnarray
Static Method
- fromArray public
SubmissionData
Represents one form's submission data
-
Method
- getSubmissionKeys public
-
Return array of action setting keys
Returnarray
Method
- getKeyedSubmissionData public
-
Return submission values matching field collection keys
Returnarray
Exception
ConstructEntityFactory
Factory to provide actions that construct or configure entities
-
Method
- constructActionSetting public
-
ReturnConstructActionSetting
Method
- constructActionSettings public
-
ReturnConstructActionSettings
FormFactory
Class FormFactory
Converts Ninja Forms objects to standard Form object
-
Method
- fromNinjaForms public
- @inheritdoc
FormProcessorsFactory
Provides classes for NF form processing
-
Method
- __construct public
-
ParamWpHooksApi $wpHooks
Method
- getWpHooks public
- @inheritdoc Method
- getSubmissionData public
- @inheritDoc Method
- getConfigureApiSettings public
- @inheritDoc Method
- getForm public
- @inheritdoc Method
- getGetApiSettingsValues public
- @inheritdoc
NfActionFactory
Factory for creating an NF Action
-
Method
- constructNinjaFormsAction public
- @inheritdoc Method
- constructNinjaFormsNewsletterAction public
- @inheritdoc
SubmissionDataFactory
-
Method
- getSubmissionData public
- @inheritdoc
NfBridge
Exposes the top-level API of the package
-
Method
- setWpHooks public
-
Set WpHooks to provide WP action hooks and filters
ParamWpHooksContract $wpHooks
Method
- getIdentifier public
- @inheritDoc Method
- getContainer public
- @inheritDoc Method
- registerServices public
-
Register the module's services
ReturnModule
CachedEndpoint
-
Method
- __construct public
-
CachedEndpoint constructor.
ParamEndpointContract $proxyEndpoint Endpoint to use for cache missesParamArrayStore $cache Key/value cache store
Method
- handleRequest public
-
Handles request from cache or passes to proxy endpoint
ParamRequestContract $requestReturnResponseContract
Method
- cacheKey protected
-
Determine cache key
ParamRequestContract $requestReturnstring
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
CachedEndpoint
-
Method
- authorizeRequest public
-
Is request authorized or not?
ParamRequestContract $request
ReturnboolThrowsException
CachedEndpoint
-
Method
- getUri public
-
Get route URI
Returnstring
Method
- getArgs public
-
Get route arguments
Returnarray
Method
- getHttpMethod public
-
Get HTTP method for endpoint
Returnstring
Method
- setUri public
-
Paramstring $uri
ReturnEndpointContract
Method
- setArgs public
-
Paramarray $args
ReturnEndpointContract
Method
- setHttpMethod public
-
Paramstring $httpMethod
ReturnHttpContract|EndpointContract
Method
- handleRequest public
-
Handle request
ParamRequestContract $request
ReturnResponseContract
Method
- getToken public
-
Get CSFR/JWT token string from request
ParamRequestContract $request
ReturnTokenContract
CachedEndpoint
-
Method
- getGuzzleClient public
-
ReturnGuzzleClientContract
Method
- setGuzzleClient public
-
ParamClient $clientReturnGuzzleClientContract
CachedEndpoint
-
Method
- send public
-
Send request
ParamRequest $requestParamstring $uriReturnResponseContract
CachedEndpoint
-
Method
- getParam public
-
Get parameter from request
Paramstring $paramName
Returnmixed
Method
- getParams public
-
Get all params of request
Returnarray
Method
- setParam public
-
Set parameter in request
Paramstring $paramNameParammixed $paramValue
ReturnHttpRequestContract
Method
- setParams public
-
Set parameters of request
Paramarray $params
ReturnHttpRequestContract
Method
- hasParam public
-
Does request have param?
Paramstring $paramName
Returnbool
Method
- getHeader public
-
Get header from request
Paramstring $headerName
Returnmixed
Method
- getHeaders public
-
Get all headers
Returnarray
Method
- setHeader public
-
Set header in request
Paramstring $headerNameParammixed $headerValue
ReturnHttpContract
Method
- hasHeader public
-
Does request have header?
Paramstring $headerName
Returnbool
Method
- getHttpMethod public
-
Set the HTTP method for the request or response
Returnstring
Method
- setHttpMethod public
-
Set the HTTP method for the request or response
Paramstring $method
ReturnHttpContract
Method
- setHeaders public
-
Set the request headers
Paramarray $headers
ReturnHttpContract
CachedEndpoint
-
Static Method
- fromArray public
- Method
- getData public
-
Get response data
Returnarray
Method
- getHeaders public
-
Get response headers
Returnarray
Method
- getStatus public
-
Get the HTTP status code
Returnint
Method
- setStatus public
-
Set the HTTP status code
Paramint $code
ReturnHttpResponseContract
Method
- setHeaders public
-
Set the request headers
Paramarray $headers
ReturnHttpContract
Method
- setData public
-
Set the response body data
Paramarray $data
ReturnHttpResponseContract
Method
- getHttpMethod public
-
Set the HTTP method for the request or response
Returnstring
Method
- setHttpMethod public
-
Set the HTTP method for the request or response
Paramstring $method
ReturnHttpResponseContract
CachedEndpoint
-
Method
- getToken public
-
Generate a token, returning its public
Returnstring
Method
- validateToken public
-
Test if string is a valid public for a token of current manager
Paramstring $tokenStringToValidate
Returnbool
Endpoint
-
Method
- getUri public
- @inheritDoc Method
- setUri public
- @inheritDoc Method
- getArgs public
- @inheritDoc Method
- setArgs public
- @inheritDoc Method
- getToken public
- @inheritDoc
Exception
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
ParamResponseInterface $responseReturnResponseContract
Method
- toPsr7Request public
-
Translate our response to a PSR-7 response
ParamRequestContract $requestParamstring|null $uriReturn\GuzzleHttp\Psr7\Request
HttpClient
Guzzle-based HTTP client
-
Method
- __construct public
-
HttpClient constructor.
ParamClient $guzzleParamPsr7 $factory
Method
- send public
- @inheritDoc Method
- getGuzzleClient public
- @inheritDoc Method
- setGuzzleClient public
- @inheritDoc
Request
-
Static Method
- fromArray public
Response
-
Static Method
- fromArray public
- Method
- getData public
- @inheritDoc Method
- setData public
- @inheritDoc Method
- getStatus public
- @inheritDoc Method
- setStatus public
- @inheritDoc
Response
-
Method
- constructParameterUri protected
-
Construct a parameter with REGEX to accept required param/value
Paramstring $param Parameter requestedParamstring $mask `numeric` `alphanumeric`Returnstring
Response
-
Method
- getHeader public
-
Get header from request
Paramstring $headerName
Returnstring|null
Method
- hasHeader public
-
Paramstring $headerName
Returnbool
Method
- setHeader public
-
Set header in request
Paramstring $headerNameParammixed $headerValue
ReturnHttpContract
Method
- getHeaders public
- @inheritdoc Method
- setHeaders public
-
Bulk assign headers
Paramarray $headersReturnHttpContract
Response
-
Method
- getHttpMethod public
-
Set the HTTP method for the request or response
Returnstring
Method
- setHttpMethod public
-
Set the HTTP method for the request or response
Paramstring $method
ReturnHttpContract
Response
-
Method
- getParam public
-
Get parameter from request
Paramstring $paramName
Returnmixed
Method
- setParam public
-
Set parameter in request
Paramstring $paramNameParammixed $paramValue
Return$this
Method
- hasParam public
-
Does request have param?
Paramstring $paramName
Returnbool
Method
- getParams public
-
Get all params of request
Returnarray
Method
- setParams public
-
Set parameters of request
Paramarray $params
ReturnHttpRequestContract
ApiModuleOpenAuthorizationAbstract
-
Method
- __construct public
-
ParamOpenAuthImplementationContract $openAuthImplementationParamGlobalSettingsStorageContract $globalSettingsStorageParamOpenAuthCredentials $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.
ReturnGlobalSettings
Method
- getAccessToken public
-
Return Access Token
Returnstring
Method
- authorizeFromAuthorizationToken public
-
Request authorization using grant_type=authorization_code
ReturnApiModuleOpenAuthorizationContract
Method
- authorizeFromRefreshToken public
-
Request authorization using grant_type=refresh_token
ReturnApiModuleOpenAuthorizationContract
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.
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
ParamRemoteRequestInterface $remoteRequest
Method
- setCredentials public
-
Set OpenAuth credentials with which to generate authorization
ParamOpenAuthCredentials $openAuthCredentialsReturnOpenAuthenticatorContract
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.
ReturnOpenAuthCredentials
Method
- setGrantTypeAuthCodeUrl public
-
Set URL for making grant_type = authorization_code request
Paramstring $grantTypeAuthCodeUrlReturnOpenAuthenticatorContract
Method
- setGrantTypeRefreshTokenUrl public
-
Set URL for making grant_type = refresh_token request
Paramstring $grantTypeRefreshTokenUrlReturnOpenAuthenticatorContract
Method
- authorizeFromAuthorizationCode public
-
Makes a grant_type = Authorization request per OAuth standards
ReturnHandledResponse
Method
- authorizeFromRefreshToken public
-
Makes a grant_type = refresh_token request per OAuth standards
ReturnHandledResponse
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.
ParamHandledResponse $handledResponseReturnHandledResponse
Method
- constructGrantTypeAuthCodeBody protected
-
Construct request body per OAuth specifications
Returnarray
Method
- constructGrantTypeRefreshTokenBody protected
-
Construct request body per OAuth specifications
Returnarray
Method
- setRequestSettings protected
- Set HTTP settings required for making HTTP request
ArrayLike
Class ArrayLike
Implementation of ArrayAccess for objects we are not ready to type.
-
Method
- __construct public
-
ArrayLike constructor.
Paramarray $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
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
Paramstring $key
Method
- append public
-
Appends an entry to the indexed array in a given key
Paramstring $key Comm Data key storing the dataParammixed $entry Value to be appended as array element
Method
- set public
-
Replaces existing value with a new value
Paramstring $keyParammixed $entry New value to be stored in key
Method
- storeCommData public
- Stores CommData array in WP options table under given key
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.
ToDouse Doctrine Insanitator?
Param$classReturnobject
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
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
ReturnGlobalSettings
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
ReturnFormFields
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.
ReturnGlobalSettings
Method
- getAccessToken public
-
Get Access Token
Access Token is expected to be generated inside this class.Returnstring
Method
- authorizeFromAuthorizationToken public
-
Request authorization via the authorization_code OpenAuth standard
ReturnOpenAuthorizationContract
Method
- authorizeFromRefreshToken public
-
Request authorization via the refresh_token OpenAuth standard
ReturnOpenAuthorizationContract
ServiceFactoryContainer
-
Method
- getKey public
-
The name of the key -- WordPress option name, database identifier, etc. -- used to store data
Returnstring
Method
- getData public
-
Get saved data
Returnarray
Method
- saveData public
-
Get the saved data
Paramarray $data Data to save
ServiceFactoryContainer
-
Method
- toArray public
-
Convert object to array
Returnarray
ServiceFactoryContainer
-
Method
- handle public
-
Process the data
ParamSubmissionData $submissionDataParamFormContract $formReturnmixed
ServiceFactoryContainer
-
Static Method
- getFieldKeys public
- Method
- getSlug public
-
Get the processor's slug/ identifier
Returnstring
ServiceFactoryContainer
-
Method
- setTitle public
-
Set the form title
Paramstring $title Form TitleReturn\NFHubspot\EmailCRM\Shared\Contracts\FormBuilder
Method
- addFormField public
-
Add form field to the form
ParamFormField $formFieldReturn\NFHubspot\EmailCRM\Shared\Contracts\FormBuilder
Method
- getTitle public
-
Get form builder title
Returnstring
Method
- getFormFields public
-
Get form fields
ReturnFormFields
Method
- toArray public
-
Return FormBuilder entity as associative array
Returnarray
ServiceFactoryContainer
-
Method
- addForm public
-
ParamFormContract $formReturnFormCollection
Method
- getForm public
-
Get a form from this collection
Paramstring $formIdReturnFormThrows\Exception
Method
- hasForm public
-
Does collection have a form of this ID?
Paramstring $formIdReturnbool
Method
- removeForm public
-
Remove a form from the collection
Paramstring $formIdReturnFormCollectionThrowsException
ServiceFactoryContainer
-
Method
- getName public
-
Get the name of the form
Returnstring
Method
- getId public
-
Get the id of the form
Returnstring
ServiceFactoryContainer
-
Method
- setGlobalSettings public
- Method
- getGlobalSettings public
-
Get GlobalSettings from this class, does NOT retrieve from storage location
ReturnGlobalSettings
Method
- storeGlobalSettings public
-
Store entire collection of GlobalSettings in a storage location
ReturnGlobalSettingsStorageContract
Method
- retrieveGlobalSettings public
-
Retrieve entire collection of GlobalSettings from a storage location
ReturnGlobalSettingsStorageContract
Method
- storeGlobalSetting public
-
Store a specified GlobalSetting in a storage location
Paramstring $idReturnGlobalSettingsStorageContract
Method
- retrieveGlobalSetting public
-
Retrieve a global setting from a storage location
Paramstring $idReturnGlobalSettingsStorageContract
ServiceFactoryContainer
-
Method
- registerServices public
-
Register all services
ReturnModule
Method
- getIdentifier public
-
Get a module's identifier
Returnstring
ServiceFactoryContainer
-
Method
- setCredentials public
-
Set OpenAuth credentials with which to generate authorization
ParamOpenAuthCredentials $credentialsReturnOpenAuthenticatorContract
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.
ReturnOpenAuthCredentials
Method
- setGrantTypeAuthCodeUrl public
-
Set URL for making grant_type = authorization_code request
Paramstring $grantTypeAuthCodeUrlReturnOpenAuthenticatorContract
Method
- setGrantTypeRefreshTokenUrl public
-
Set URL for making grant_type = refresh_token request
Paramstring $grantTypeRefreshTokenUrlReturnOpenAuthenticatorContract
Method
- authorizeFromAuthorizationCode public
-
ReturnHandledResponse
Method
- authorizeFromRefreshToken public
-
ReturnHandledResponse
ServiceFactoryContainer
-
Method
- setUrl public
-
Set HTTP request URL
Paramstring $urlReturn\NFHubspot\EmailCRM\WpBridge\Contracts\RemoteRequestContract
Method
- setHttpArg public
-
Set an HTTP argument
Paramstring $argParamtype $valueReturn\NFHubspot\EmailCRM\WpBridge\Contracts\RemoteRequestContract
Method
- addQueryArg public
-
Add a querystring argument
Paramstring $argParamtype $valueReturn\NFHubspot\EmailCRM\WpBridge\Contracts\RemoteRequestContract
Method
- setBody public
-
Set HTTP request body
Paramtype $bodyReturn\NFHubspot\EmailCRM\WpBridge\Contracts\RemoteRequestContract
Method
- setHeaderParameter public
-
Set an HTTP header parameter
Paramtype $arg
Paramtype $value
Return\NFHubspot\EmailCRM\WpBridge\Contracts\RemoteRequestContract
Method
- handle public
ServiceFactoryContainer
-
Method
- bind public
-
Bind a service to the container.
Paramstring $alias Alias for classParamobject|\Closure $concrete Concrete class
Method
- make public
-
Request a service from the container.
Paramstring $alias Alias for classReturnobject|mixed
Method
- singleton public
-
Bind a singleton instance to the container.
Paramstring $alias Alias for classParamobject $binding Single instance of object to bind
ServiceFactoryContainer
-
Method
- addFactory public
-
Add a factory to the container
Paramstring $service Name of service factoryParamServiceFactoryContract $serviceFactoryReturnServiceFactoryContainerContract
Method
- useFactory public
-
Use a factory from the container
Paramstring $service Name of service factoryParamarray $argsReturnmixed
Method
- hasFactory public
-
Does container contain factory?
Paramstring $service Name of service factoryReturnbool
ServiceFactoryContainer
-
Method
- handle public
-
Handle a request for this factory
Paramarray $args Arguments for factoryParamServiceFactoryContainer $container Container that contains this factoryReturnmixed
ServiceFactoryContainer
-
Method
- getValue public
-
Get value or default
Paramstring $keyParamnull $defaultReturnmixed|null
ServiceFactoryContainer
-
Method
- applyFilters public
-
Apply filters to given property
Paramstring $tagParammixed $incomingParamint $priorityParamint $acceptedArgs
Method
- addFilter public
-
Add filter to given tag
Paramstring $tagParamtype $hook
Method
- addAction public
-
Paramstring $tagParamtype $hook
Method
- updateOption public
-
Wrap update_option
Paramstring $keyParamtype $data
FormBuilder
Shared form entity that can be transported across bridges
-
Method
- __construct public
- Construct a new FormBuilder object Method
- setTitle public
-
Set form title
Paramstring $titleReturnFormBuilder
Method
- addFormField public
-
Add form field to the form builder
ParamFormField $formFieldReturnFormBuilder
Method
- getTitle public
-
Get form builder title
Returnstring
Method
- getFormFields public
-
Get form fields
ReturnFormFields
Method
- toArray public
-
Return FormBuilder entity as associative array
Returnarray
FormField
Form field entity shared by CF and NF
-
Method
- setId public
-
Set the field Id
Paramstring $id Field IdReturnSimpleEntity
Method
- setLabel public
-
Set the field label
Paramstring $label Field labelReturnSimpleEntity
Method
- setType public
-
Set the field type
Paramstring $type Field typeReturnSimpleEntity
Method
- setDefault public
-
Set the default value
Paramtype $default Default valueReturnSimpleEntity
Method
- setRequired public
-
Set Required parameter
Parambool $required Boolean of `is required?`ReturnSimpleEntity
Method
- setDescription public
-
Set the field description
Paramstring $description Field descriptionReturnSimpleEntity
Method
- setCharacterLimit public
-
Set the character limit for the field
Paramint $limitReturnSimpleEntity
Method
- setOptions public
-
Set field options
ParamOptions $optionsReturnSimpleEntity
Method
- getId public
-
Get field id
Returnstring
Method
- getLabel public
-
Get field label
Returnstring
Method
- getType public
-
Get field type
Returnstring
Method
- getDefault public
-
Get field default value
Returnmixed
Method
- getRequired public
-
Get field required boolean
Returnbool
Method
- getDescription public
-
Get field description
Returnstring
Method
- getOptions public
-
Get options
ReturnOptions
Method
- getCharacterLimit public
-
Get character limit for the field; 0 indicates no limit
Returnint
Static Method
- fromArray public
FormFields
Collection of form field entities shared by CF and NF
-
Method
- addFormField public
-
Add a form field the fields collection
ParamFormField $fieldReturn\NFHubspot\EmailCRM\Shared\Entities\FormFields
Method
- getField public
-
Get form field specified by Id
Paramstring $id Id of fieldReturnFormFieldThrowsException
Method
- getFields public
-
Return collection of all form fields
Returnarray
Method
- toArray public
-
Return array of all form fields
Returnarray
Static Method
- fromArray public
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
Returnstring
Method
- getLabel public
-
Return Global setting label
Returnstring
Method
- getExpectedDataType public
-
Return Global setting data type
Returnstring
Method
- getValue public
-
Get the value for the GlobalSetting
Returnmixed
Method
- setId public
-
Set Global setting Id
Paramstring $stringValueReturnGlobalSetting
Method
- setLabel public
-
Set Global setting label
Paramstring $stringValueReturnGlobalSetting
Method
- setExpectedDataType public
-
Set Global setting expected data type
Paramstring $stringValueReturnGlobalSetting
Method
- setValue public
-
Set the value for the GlobalSetting
Paramtype $paramReturn\NFMailchimp\EmailCRM\Shared\Entities\GlobalSetting
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
Returnstring
Method
- getLabel public
-
Return Global setting label
Returnstring
Method
- setId public
-
Set Global setting Id
Paramstring $stringValueReturnGlobalSettings
Method
- setLabel public
-
Set Global setting label
Paramstring $stringValueReturnGlobalSettings
Static Method
- fromArray public
- Method
- toArray public
-
Convert GlobalSetting object into associative array
Returnarray
Method
- addGlobalSetting public
-
Add an Global Setting to collection
ParamGlobalSetting $globalSetting
ReturnGlobalSettings
Method
- getGlobalSetting public
-
Get a Global Setting from collection
Paramstring $key
ReturnGlobalSettingThrowsException
Method
- getGlobalSettings public
-
Get all Global Settings in collection
ReturnGlobalSetting[]
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
Paramstring $stringReturn\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
- getContext public
-
Get the context
Returnstring
Method
- setRecordCount public
-
Set the record count
Paramint $intReturn\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
- getRecordCount public
-
Get the record count
Returnint
Method
- setRecords public
-
Set the records collection
Paramarray $arrayReturn\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
- appendRecord public
-
Append a single record to the record collection
Paramstring $stringReturn\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
- appendRecords public
-
Append a array of records to the collection
Paramarray $arrayReturn\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
- getRecords public
-
Get the record collection
Returnarray
Method
- setTimestamp public
-
Set the timestamp
Paramint $intReturn\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
- getTimestamp public
-
Get the timestamp
Returnint
Method
- setIsSuccessful public
-
Set IsSuccessful
Parambool $boolReturn\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
- isSuccessful public
-
Get IsSuccessful
Returnbool
Method
- setIsWpError public
-
Set IsWpError
Parambool $boolReturn\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
- isWpError public
-
Get IsWpError
Returnbool
Method
- setIsApiError public
-
Set IsApiError
Parambool $boolReturn\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
- isApiError public
-
Get IsApiError
Returnbool
Method
- setIsException public
-
Set IsException
Parambool $boolReturn\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
- isException public
-
Get IsException
Returnbool
Method
- setHasNoData public
-
Set HasNoData
Parambool $boolReturn\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
- hasNoData public
-
Get HasNoData
Returnbool
Method
- setErrorCode public
-
Set ErrorCode
Paramint $intReturn\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
- getErrorCode public
-
Get ErrorCode
Returnint
Method
- setErrorMessages public
-
Get ErrorMessages
Paramarray $arrayReturn\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
- appendErrorMessage public
-
Append a single error message to collection
Paramstring $stringReturn\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
- getErrorMessages public
-
Get ErrorMessages
Returnarray
Method
- setResponseBody public
-
Set ResponseBody
Paramstring $stringReturn\NFHubspot\EmailCRM\Shared\Entities\HandledResponse
Method
- getResponseBody public
-
Get ResponseBody
Returnstring
OpenAuthCredentials
Entity to accept and provide data for Open Authorization protocol
-
Method
- setClientId public
-
Set client id
Paramstring $clientIdReturnSimpleEntity
Method
- getClientId public
-
Get client id
Returnstring
Method
- setClientSecret public
-
Set client secret
Paramstring $clientSecretReturnSimpleEntity
Method
- getClientSecret public
-
Get client secret
Returnstring
Method
- setAuthorizationCode public
-
Set authorization code
Paramstring|null $authorizationCodeReturnSimpleEntity
Method
- getAuthorizationCode public
-
Get authorization code
Returnstring
Method
- setRedirectUri public
-
Set redirect URI
Paramstring|null $redirectUriReturnSimpleEntity
Method
- getRedirectUri public
-
Get redirect URI
Returnstring
Method
- setRefreshToken public
-
Set refresh token
Paramstring|null $refreshTokenReturnSimpleEntity
Method
- getRefreshToken public
-
Get refresh token
Returnstring
Method
- setAccessToken public
-
Set access token
Paramstring|null $accesstokenReturnSimpleEntity
Method
- getAccessToken public
-
Get access token
Returnstring
Option
Option entity
This entity is used to construct an option
-
Method
- getLabel public
-
Return option label
Returnstring
Method
- getValue public
-
Return option value
Returnstring
Method
- setLabel public
-
Set option label
Paramstring $stringValueReturnOption
Method
- setValue public
-
Set option label
Paramstring $stringValueReturnOption
Options
Collection of option entities
-
Method
- addOption public
-
Add Option to the collection
ParamOption $optionReturn\NFHubspot\EmailCRM\NfBridge\Entities\options
Method
- toArray public
-
Return option collection as array
Returnarray
Static Method
- fromArray public
ResponseData
Class ResponseData
Provides standardized data from a response with meta data
-
Static Method
- fromArray public
- Method
- toArray public
-
Return array of ResponseData
Returnarray
Method
- getResponse public
-
Return Response
Returnstring
Method
- getMessage public
-
Return Message
Returnstring
Method
- getContext public
-
Return Context
Returnstring
Method
- getDiagnostics public
-
Return Diagnostics
Returnstring
Method
- getType public
-
Return Type
Returnstring
Method
- getNote public
-
Return Note
Returnstring
Method
- setResponse public
-
Set Response
ReturnSimpleEntity
Method
- setMessage public
-
Set Message
ReturnSimpleEntity
Method
- setContext public
-
Set Context
ReturnSimpleEntity
Method
- setDiagnostics public
-
Set Diagnostics
ReturnSimpleEntity
Method
- setType public
-
Set Type
ReturnSimpleEntity
Method
- setNote public
-
Set Note
ReturnSimpleEntity
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
Paramstring $keyParamnull $defaultReturnmixed|null
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
Paramarray $handledResponseCollectionReturnHandledResponse
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
Returnbool
Method
- setInvalidRequestResponse protected
- Sets handled response when incoming request is invalid
SimpleEntity
-
Method
- toArray public
- @inheritdoc Static Method
- fromArray public
- Method
- jsonSerialize public
- Method
- __get public
- @inheritdoc Method
- __set public
- @inheritdoc
InMemoryArrayStore
Implimentation of ArrayStore that is for testing.
-
Method
- __construct public
- Method
- getData public
- Method
- saveData public
- @inheritDoc Method
- getKey public
- @inheritDoc
InMemoryArrayStore
-
Static Method
- fromArray public
- Static Method
- unSnake protected
InMemoryArrayStore
-
Method
- toArray public
- @inheritdoc Method
- getterName protected
- Method
- snake protected
-
Convert camel-cased string to snake case
Seehttps://stackoverflow.com/a/1993772Paramstring $strReturnstring
InMemoryArrayStore
-
Method
- __get public
-
Get a single config value
Paramstring $name Value nameReturnmixed
Method
- __set public
-
Update a single config value
Paramstring $name Value nameParammixed $value New valueReturnSimpleEntity
Static Method
- fromArray public
- Method
- jsonSerialize public
- @inheritDoc Method
- hasValue public
-
Can this object supply a value?
Paramstring $name Name of the valueReturnbool
Method
- toArray public
- @inheritDoc Method
- setItems protected
- Method
- addData public
-
At item to collection
Paramstring $keyParam$value
InMemoryArrayStore
-
Method
- addFilter public
-
Provide WP's add_filter() functionality
Paramstring $filterNameParammixed $incomingParamint $priorityParamint $acceptedArgsReturnmixed
Method
- applyFilters public
-
Provide WP's apply_filters() functionality
Paramstring $filterNameParammixed $incomingReturnmixed
Method
- addAction public
-
Provide WP's add_action functionality
Paramstring $tagParamarray|string|callable $hook
Method
- wpNonceField public
-
Provide WP's wp_nonce_field functionality
Paramint|string $actionParamstring $nameParambool $refererParambool $echo
InMemoryArrayStore
-
Method
- updateOption public
-
Wraps WordPress' update_option()
Paramstring $keyParamarray|string|integer $data
Method
- getOption public
-
Wraps WordPress' get_option()
Paramstring $keyReturnmixed
InMemoryArrayStore
-
Method
- setWpdb public
-
Set a new instance of WPDB.
Param\WPDB $wpdbReturn$this
Method
- getWpdb public
-
Get current instance of WPDB
Return\WPDB
Method
- getResults public
-
Sql to query, using WordPress
wpdb::getResults($sql)
Paramstring $sql The sql query to get results forReturn\stdClass[]
OptionsStore
A getter/setter for using options table as key/ value store where value is an array
-
Method
- __construct public
-
OptionsStore constructor.
Paramstring $key The name of the key
Method
- getData public
- @inheritDoc Method
- getKey public
- @inheritDoc Method
- saveData public
- @inheritDoc
TransientStore
A getter/setter for using transients as key/ value store where value is an array
-
Method
- __construct public
-
TransientStore constructor.
Paramstring $key The name of the key
Method
- getData public
- @inheritDoc Method
- getKey public
- @inheritDoc Method
- saveData public
- @inheritDoc
UseWpdb
-
Method
- __construct public
- Method
- setWpdb public
- @inheritDoc Method
- getWpdb public
- @inheritDoc Method
- getResults public
- @inheritDoc
WPOptionsApi
-
Method
- updateOption public
- @inheritDoc Method
- getOption public
- @inheritDoc
MailchimpWpHttpClient
Class MailchimpWpHttpClient
For the Mailchimp API client -- uses WordPress HTTP API
-
Method
- handleRequest public
- @inheritdoc
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
Paramstring $urlReturnRemoteRequestContract
Method
- setHttpArg public
-
Set an HTTP argument
Paramstring $argParammixed $valueReturnRemoteRequestContract
Method
- addQueryArg public
-
Set an HTTP argument
Paramstring $argParammixed $valueReturnRemoteRequestContract
Method
- setBody public
-
Set HTTP request body
Parammixed $bodyReturnRemoteRequestContract
Method
- setHeaderParameter public
-
Set an HTTP header parameter
Paramstring $argParammixed $valueReturnRemoteRequestContract
Method
- finalizeRequest protected
- Method
- handle public
-
ReturnHandledResponse
Method
- setDefaultHttpArgs protected
- Set default arguments
AuthorizeRequestWithWordPressUser
Class AuthorizeRequestWithWordPressUser
WordPress capability-based authorization check for routes
-
Method
- __construct public
-
AuthorizeRestRequest constructor.
Paramstring $capability
Method
- authorizeRequest public
-
ParamRequestContract $requestReturnbool
CreateWordPressEndpoints
Create and endpoint on the WordPress REST API
-
Method
- __construct public
-
CreateEndpoint constructor.
Paramcallable $registrationFunctionParamstring $namespace
Method
- registerRouteWithWordPress public
-
Register an endpoint with WordPress
ParamEndpoint $endpoint
Method
- wpArgs public
-
Create arguments for register_rest_route()
ParamEndpoint $endpoint
Returnarray
Method
- createCallBack protected
-
Create the callable function for WordPress to use as the callback for this endpoint
Paramcallable $handlerReturncallable
Method
- createAuthCallBack protected
-
Create a callable function WordPress will call to authorize the request
Paramcallable $handlerReturncallable
Method
- requestFromWp protected
-
Create instance of request class from a WordPress request
Param\WP_REST_Request $_request
ReturnRequest
WpBridge
Exposes the top-level API of the package
-
Method
- getIdentifier public
- @inheritDoc Method
- registerServices public
-
Register the module's services
ReturnModule
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.
Paramstring $filterNameParammixed $incomingReturnmixed
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.
Paramstring $filterNameParammixed $callbackParamint $priorityParamint $accepted_argsReturnmixed
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.
Paramstring $tagParamarray|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
Paramint|string $actionParamstring $nameParambool $refererParambool $echo
Method
- wpRestUrl public
-
Return the wp_rest_url parameter
Returnstring
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 */
AdminSettings
Description of AdminSettings
-
Method
- __construct public
- Method
- adminAjax public
-
Handle AdminAJAX requests
ReturnVoid
Method
- updateCustomFields protected
-
Request custom field update, returning results for feedback
ReturnString
Method
- saveApiKeyOnChange protected
-
Update Ninja Forms Api Key setting
ReturnString
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
ReturnVoid
Method
- determineActionSettingGroup protected
-
Determine the group location for a given FormField
ParamFormField $apiFormField
ReturnString
Method
- createActionSettingsGroups public
-
Create groupings for the action field mapping
Enables large lists of field maps to be organized into manageable groups
ParamArray $groups
ReturnArray
MetaboxOutput
-
Method
- handle public
- Static Method
- extractResponses protected
- Static Method
- addContext protected
- Static Method
- addResult protected
- Static Method
- addRecord protected
OAuthConnection
-
Method
- __construct public
-
Constructor
ReturnVoid
Method
- oauthUpgradeNotice public
-
Function to notify users who need to upgrade
from API Key to oAuth.
ParamArray $notices
ReturnArray $notices
Method
- oauthReconnectNotice public
-
Function to notify users who need to reconnect
ParamArray $notices
ReturnArray $notices
Method
- isOauthRequest public
-
Checks if current request is oAuth request
ReturnBool
Method
- handleOauthRequest public
-
Handle an oAuth Request
ReturnVoid
Method
- hasAPIKey public
-
Checks if API Key (old method) exists
ReturnBool
Method
- getOption private
-
Get NF Setting Option
ParamString $key
ReturnMixed
Method
- setOption private
-
Set NF Settings Option
ParamString $keyParamString $value
ReturnVoid
Method
- saveSettings private
-
Save settings
ReturnVoid
Method
- getAccessToken public
-
Return Access Token
ReturnString
Method
- getRefreshToken protected
-
Return Refresh Token
ReturnString
Method
- refreshTokens public
-
Refresh Tokens
ReturnVoid
Method
- handleApiRefresh protected
-
Refresh token via API request
ReturnVoid
Method
- saveTokens protected
-
Save New Tokens
ReturnVoid
Method
- deleteTokens protected
-
Delete Tokens
ReturnVoid
Method
- isConnected public
-
Check if we're connected
ReturnBool
Method
- isExpired public
-
Check if current access token is expired
ReturnBool
Method
- generate_key public
-
Generates secret key
ReturnString
Method
- getKey protected
-
Get Key
ReturnString
OAuthConnection
-
Method
- initRestApi public
-
Initialize the REST API endpoints
Since3.2.0
@uses "rest_api_init" hook.
Method
- setNfBridge public
-
Set the NfBridge
ParamNfBridgeContract $nfBridgeReturnNinjaFormsMailchimpContract
Method
- getNfBridge public
-
Get the NfBridge
ReturnNfBridgeContract
Method
- setApiModule public
-
Get instance of top level API Module
ReturnHubspotContractSince3.0.0
Method
- getApiModule public
-
Set instance of top level API Module
ReturnHubspotContractSince3.0.0
AutogenerateFormEndpoint
Endpoint to handle a form autogenerate request
-
Method
- setAutogenerateForm public
-
Set the autogenerate form
ParamAutogenerateForm $autogenerateForm
Method
- addAuthorizer public
-
Add an authorizer that ensures source of request is authorized
ParamAuthorizeRequestContract $authorizer
Method
- getHttpMethod public
- @inheritDoc Method
- getArgs public
- @inheritDoc Method
- getUri public
- @inheritDoc Method
- authorizeRequest public
-
Authorize the request
ParamRequestContract $requestReturnbool
Method
- handleRequest public
- @inheritDoc Method
- constructExceptionResponse protected
-
Construct exception response from given exception
Param\Exception $exceptionParamstring $contextReturnResponseContract
Configure
Provides configured Integrating Plugin-specific entities
-
Method
- __construct public
-
Instantiate with top-level file directory to provide access throughout
Paramstring $dir
Method
- autogenerateModalMarkup public
-
Return autogenerate modal markup
Used to construct Add New modal boxReturnModal
Method
- actionEntity public
-
Provide ActionEntity defining the primary action of the integrating plugin
ReturnActionEntity
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 processedParamarray $data Form field process dataReturnarray
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.
ParamArray $templates
ReturnArray
Method
- addMetabox public
-
Add a metabox constructor to the react.js submissions page
ParamArray $metaboxHandlers
ReturnArray
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.
ReturnVoid
Method
- initRestApi public
-
Initialize the REST API endpoints
Since3.0.0
@uses "rest_api_init" hook.
ReturnVoid
Method
- updateCustomFields public
-
Store custom fields as requested and provided by the API Module
ReturnFormFields
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.
ReturnFormFields
Method
- setNfBridge public
-
Set the NF Bridge to provide NF functionality
ParamNfBridgeContract $nfBridge
ReturnNinjaFormsHubspot
Method
- getNfBridge public
-
Return the NF Bridge object
ReturnNfBridgeContract
Method
- setApiModule public
-
Set the API Module
ParamApiModuleContract $apiModule
ReturnMainInstanceContract
Method
- initializeApiModule protected
-
Initialize API Module with settings values
ReturnVoid
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.
ParamGlobalSettings $incoming
ReturnGlobalSettings
Method
- removeApiKeyFromGlobalSettings protected
-
Remove the API key from the global settings to ensure only OAuth is available
ParamGlobalSettings $incoming
ReturnGlobalSettings
Method
- disableApiKeyInGlobalSettings protected
-
Disable the API key from the global settings but keep it for use
ParamGlobalSettings $incoming
ReturnGlobalSettings
Method
- getApiModule public
-
Return the API Module
ReturnApiModuleContract
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
ReturnModule
Method
- setupAdmin public
-
Setup Admin
Setup admin classes for Ninja Forms and WordPress.
ReturnVoid
Method
- getIdentifier public
- @inheritDoc
TestCase
-
Method
- loadTestData public
-
Load some test data
Paramstring $fileReturnarray
Method
- loadArrayData public
-
Load array data returned as array from config file
Paramstring $file PHP file name including extensionReturnarray
Method
- setUpUnitTestMockEnvironment public
-
Sets up a mock environment for unit tests
Adds just enough function shims to do unit testing in specific areas.
Unit tests must not rely upon any of the shimmed functions, which are
present only to prevent construction errors from missing function dependencies.
Returnvoid
Method
- defineAbspath protected
-
Set ABSPATH to the Wordpress directory
Returnvoid
Method
- UnitShims protected
-
Include WP shims not handled by Brain Monkey
Returnvoid
Method
- shimNinjaForms protected
-
Shim basic Ninja_Forms() functionality to enable unit testing
Returnvoid
Method
- configureGetOption public
-
Mock get_option and update_option with global array variable
Paramarray $incomingOptionsReturnvoid
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
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
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
ReturnGlobalSettings
Method
- setGlobalSettings public
-
Set the GlobalSettings
ParamGlobalSettings $globalSettingsReturnGlobalSettingsStorageContract
Method
- retrieveGlobalSetting public
-
Return the required contract without a live data source
Paramstring $idReturnGlobalSettingsStorageContract
Method
- retrieveGlobalSettings public
-
Return the required contract without a live data source
Paramstring $idReturnGlobalSettingsStorageContract
Method
- storeGlobalSetting public
-
Return the required contract without a live data source
Paramstring $idReturnGlobalSettingsStorageContract
Method
- storeGlobalSettings public
-
Return the required contract without a live data source
ReturnGlobalSettingsStorageContract
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 */
NinjaFormsHubspotTest
-
Method
- testConstants public
- Ensure that required constants are set
UnitTestCase
UnitTestCase
-
Method
- add_shortcode <?php
UnitTestCase
-
Method
- esc_html__ <?php
UnitTestCase
-
Method
- get_option
- Method
- update_option
Ninja_Forms
This is a shim for Ninja Forms; it does not function, but it provides the named functionality such that unit tests for classes that call Ninja_Forms() on construct can be instantiated without errors. The unit tests calling this instance MUST NOT use any Ninja_Forms() functionality as the results cannot be trusted. Such integration tests will require an environment in which a true Ninja_Forms() class can operate.
-
Static Method
- instance public
- Method
- form public
-
Form Model Factory Wrapper
Param$idReturnNF_Abstracts_ModelFactory
Method
- logger public
-
Logger Class Wrapper
Example Use: Ninja_Forms()->logger()->log( 'debug', "Hello, {name}!", array( 'name' => 'world' ) ); Ninja_Forms()->logger()->debug( "Hello, {name}!", array( 'name' => 'world' ) );
Returnstring
Method
- dispatcher public
- Method
- eos public
- Method
- session public
- Method
- request public
- Method
- background_process public
- Method
- get_setting public
-
Get a setting
Paramstring $keyParambool|false $defaultReturnbool
Method
- get_settings public
-
Get all the settings
Returnarray
Method
- update_setting public
-
Update a setting
Paramstring $keyParammixed $valueParambool|false $defer_update Defer the database update of all settings
Method
- update_settings public
-
Save settings to database
Paramarray $settings
Static Method
- template public
- Static Method
- config public
- Method
- Ninja_Forms /** * The main function responsible for returning The Highlander Ninja_Forms * Instance to functions everywhere. * * Use this function like you would a global variable, except without needing * to declare the global. * * Example: <?php $nf = Ninja_Forms(); ?> * * @since 2.7 * @return Ninja_Forms Highlander Instance */
Ninja_Forms
-
Method
- plugins_url <?php
- Method
- is_ssl
Ninja_Forms
-
Method
- __
Ninja_Forms
-
Method
- remove_all_filters /** * Remove all of the hooks from a filter. * * @since 2.7.0 * * @global WP_Hook[] $wp_filter Stores all of the filters and actions. * * @param string $tag The filter to remove hooks from. * @param int|false $priority Optional. The priority number to remove. Default false. * @return true True when finished. */
-
The plugin API is located in this file, which allows for creating actions
and filters and hooking functions, and methods. The functions or methods will
then be run when the action or filter is called.
The API callback examples reference functions, but can be methods of classes. To hook methods, you'll need to pass an array one of two ways.
Any of the syntaxes explained in the PHP documentation for the {Linkhttps://www.php.net/manual/en/language.pseudo-types.php#language.types.callback 'callback'} type are valid.
Also see the {Linkhttps://developer.wordpress.org/plugins/ Plugin API} for more information and examples on how to use a lot of these functions.
This file should have no external dependencies.
PackageWordPressSubpackagePluginSince1.5.0
Method
- current_action /** * Retrieve the name of the current action. * * @since 3.9.0 * * @return string Hook name of the current action. */
- Method
- remove_all_actions /** * Remove all of the hooks from an action. * * @since 2.7.0 * * @param string $tag The action to remove hooks from. * @param int|false $priority The priority number to remove them from. Default false. * @return true True when finished. */
- Method
- plugin_basename /** * Gets the basename of a plugin. * * This method extracts the name of a plugin from its filename. * * @since 1.5.0 * * @global array $wp_plugin_paths * * @param string $file The filename of plugin. * @return string The name of a plugin. */
- Method
- wp_register_plugin_realpath /** * Register a plugin's real path. * * This is used in plugin_basename() to resolve symlinked paths. * * @since 3.9.0 * * @see wp_normalize_path() * * @global array $wp_plugin_paths * * @param string $file Known path to the file. * @return bool Whether the path was able to be registered. */
- Method
- plugin_dir_path /** * Get the filesystem directory path (with trailing slash) for the plugin __FILE__ passed in. * * @since 2.8.0 * * @param string $file The filename of the plugin (__FILE__). * @return string the filesystem path of the directory that contains the plugin. */
- Method
- plugin_dir_url /** * Get the URL directory path (with trailing slash) for the plugin __FILE__ passed in. * * @since 2.8.0 * * @param string $file The filename of the plugin (__FILE__). * @return string the URL path of the directory that contains the plugin. */
- Method
- register_activation_hook /** * Set the activation hook for a plugin. * * When a plugin is activated, the action 'activate_PLUGINNAME' hook is * called. In the name of this hook, PLUGINNAME is replaced with the name * of the plugin, including the optional subdirectory. For example, when the * plugin is located in wp-content/plugins/sampleplugin/sample.php, then * the name of this hook will become 'activate_sampleplugin/sample.php'. * * When the plugin consists of only one file and is (as by default) located at * wp-content/plugins/sample.php the name of this hook will be * 'activate_sample.php'. * * @since 2.0.0 * * @param string $file The filename of the plugin including the path. * @param callable $function The function hooked to the 'activate_PLUGIN' action. */
- Method
- register_deactivation_hook /** * Set the deactivation hook for a plugin. * * When a plugin is deactivated, the action 'deactivate_PLUGINNAME' hook is * called. In the name of this hook, PLUGINNAME is replaced with the name * of the plugin, including the optional subdirectory. For example, when the * plugin is located in wp-content/plugins/sampleplugin/sample.php, then * the name of this hook will become 'deactivate_sampleplugin/sample.php'. * * When the plugin consists of only one file and is (as by default) located at * wp-content/plugins/sample.php the name of this hook will be * 'deactivate_sample.php'. * * @since 2.0.0 * * @param string $file The filename of the plugin including the path. * @param callable $function The function hooked to the 'deactivate_PLUGIN' action. */
- Method
- register_uninstall_hook /** * Set the uninstallation hook for a plugin. * * Registers the uninstall hook that will be called when the user clicks on the * uninstall link that calls for the plugin to uninstall itself. The link won't * be active unless the plugin hooks into the action. * * The plugin should not run arbitrary code outside of functions, when * registering the uninstall hook. In order to run using the hook, the plugin * will have to be included, which means that any code laying outside of a * function will be run during the uninstallation process. The plugin should not * hinder the uninstallation process. * * If the plugin can not be written without running code within the plugin, then * the plugin should create a file named 'uninstall.php' in the base plugin * folder. This file will be called, if it exists, during the uninstallation process * bypassing the uninstall hook. The plugin, when using the 'uninstall.php' * should always check for the 'WP_UNINSTALL_PLUGIN' constant, before * executing. * * @since 2.7.0 * * @param string $file Plugin file. * @param callable $callback The callback to run when the hook is called. Must be * a static method or function. */
- Method
- _wp_call_all_hook /** * Call the 'all' hook, which will process the functions hooked into it. * * The 'all' hook passes all of the arguments or parameters that were used for * the hook, which this function was called for. * * This function is used internally for apply_filters(), do_action(), and * do_action_ref_array() and is not meant to be used from outside those * functions. This function does not check for the existence of the all hook, so * it will fail unless the all hook exists prior to this function call. * * @since 2.5.0 * @access private * * @global WP_Hook[] $wp_filter Stores all of the filters and actions. * * @param array $args The collected parameters from the hook that was called. */
- Method
- _wp_filter_build_unique_id /** * Build Unique ID for storage and retrieval. * * The old way to serialize the callback caused issues and this function is the * solution. It works by checking for objects and creating a new property in * the class to keep track of the object and new objects of the same class that * need to be added. * * It also allows for the removal of actions and filters for objects after they * change class properties. It is possible to include the property $wp_filter_id * in your class and set it to "null" or a number to bypass the workaround. * However this will prevent you from adding new classes and any new classes * will overwrite the previous hook by the same class. * * Functions and static method callbacks are just returned as strings and * shouldn't have any speed penalty. * * @link https://core.trac.wordpress.org/ticket/3875 * * @since 2.2.3 * @since 5.3.0 Removed workarounds for spl_object_hash(). * `$tag` and `$priority` are no longer used, * and the function always returns a string. * @access private * * @param string $tag Unused. The name of the filter to build ID for. * @param callable $function The function to generate ID for. * @param int $priority Unused. The order in which the functions * associated with a particular action are executed. * @return string Unique function ID for usage as array key. */
Ninja_Forms
-
Method
- _manually_load_plugin
Ninja_Forms
-
Method
- __
TestCase
-
Method
- loadTestData public
-
Load some test data
Paramstring $fileReturnarray
Method
- loadArrayData public
-
Load array data returned as array from config file
Paramstring $file PHP file name including extensionReturnarray
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
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
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
ConvertFieldPropertiesIntoFormFieldsTest
Test ConvertFieldPropertiesIntoFormFields class
-
Method
- testHandle public
- Test that class successfully converts successful and unsuccessful request @covers NFHubspot\EmailCRM\Hubspot\Sdk\ConvertFieldPropertiesIntoFormFields::handle()
CreateRecordsFormActionHandlerTest
Test FormActionHandler functionality
-
Method
- testValidations public
-
Ensure that validation method returns the correct validated values
@test
Returnvoid
extends
-
Method
- __construct public
- Method
- exposeValidateValueByFieldType public
-
Provide external access to method
Parammixed $rawValueParamstring $fieldTypeReturnvoid
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) @testReturnvoid
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) @testReturnvoid
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
$this
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
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()
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()
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
-
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
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
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
ReturnHandledResponse
Method
- finalizeRequest protected
- Overrides finalizeRequest to skip add_query_args WordPress function
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
UnitTestCase
UnitTestCase
-
Method
- _manually_load_plugin
UnitTestCase
-
Method
- __
TestCase
-
Method
- loadTestData public
-
Load some test data
Paramstring $fileReturnarray
Method
- loadArrayData public
-
Load array data returned as array from config file
Paramstring $file PHP file name including extensionReturnarray
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
-
Method
- getCollection protected
-
Load and return specified sample HandledResponse collection data
Paramtype $collectionNameReturnarray
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.
Paramarray $array