Last Updated: Jul. 14, 2022 at 09:01pm UTC
Class

AbstractCiviObject

Method
__construct public
Call protected child method that instantiates CiviCRM object
Method
getFields public
@inheritDoc
Method
getCiviObject protected
Class

AbstractCiviObjectCreateable

Method
__construct public
Construct with calls to protected methods defining required objects
The CiviCrm and CreateObjectResponse objects are instantiated in protected methods required by this parent class.
Method
create public
@inheritDoc
Method
constructParentNameValuePairs protected
Construct name=>value pairs given parent ids keyed on entity name
This method is a function hook that can be overridden by concrete implementations. By default, there are no links provided for parent/child record linking. A concrete implementation can override this default behavior by providing such key-value pairs.
An array of entity=>recordId pairs are passed in. Should any of the given keys be parents of this class's entity, this method should return the fieldKey=>recordId that links this class's entity to that parent.
Param
array $parentIds Array of parent ids keyed on entity e.g. 'Contact'=>'000'
Return
array Name value pairs of parent ids for the object
Method
getResponse public
Return the CreateObjectResponse
Return
CreateObjectResponse
Class

AbstractCiviObjectRetrievable

Method
__construct public
Construct with calls to protected methods defining required objects
The CiviCrm and GetRecordsResponse objects are instantiated in protected methods required by this parent class.
Method
getGetRecordsResponse protected
Method
getRecords public
Request records from CiviCrm using its API
Return
array
Class

Activity

Honors NinjaForms' Contracts activity using CiviCRM's API v4

Method
getCiviObject protected
@inheritDoc
Method
constructParentNameValuePairs protected
Given parent ids keyed on entity, constructs name=>value pairs
Incoming array receives key with record Id for association. $parentIds specify the key under which the incoming id will be set 'ActivityAddedByContact'=>'123' will be mapped as 'source_contact_id'=>123 'ActivityWithContact'=>'456' will be mapped as 'target_contact_id'=>[456]
Class

Address

Honors NinjaForms' Contracts Address using CiviCRM's API v4

Method
getCiviObject protected
@inheritDoc
Method
constructParentNameValuePairs protected
@inheritDoc
Class

Contact

Honors NinjaForms' Contracts contact using CiviCRM's API v4

Method
getCiviObject protected
@inheritDoc
Method
hasMatch public
@inheritDoc
Method
getMatchingId public
@inheritDoc
Method
peformUfMatch protected
Perform UfMatch check to determine logged in user match
Return
void
Class

ContactType

Honors NinjaForms' Contracts ContactType using CiviCRM's API v4

Method
getCiviObject protected
@inheritDoc
Method
getGetRecordsResponse protected
@inheritDoc
Class

Country

Honors NinjaForms' Contracts Country using CiviCRM's API v4

Method
getCiviObject protected
@inheritDoc
Method
getGetRecordsResponse protected
@inheritDoc
Class

DedupeRule

Honors NinjaForms' Contracts DedupeRule using CiviCRM's API v4

Method
getCiviObject protected
@inheritDoc
Method
getGetRecordsResponse protected
@inheritDoc
Class

DedupeRuleGroup

Honors NinjaForms' Contracts DedupeRuleGroup using CiviCRM's API v4

Method
getCiviObject protected
@inheritDoc
Method
getGetRecordsResponse protected
@inheritDoc
Class

Email

Honors NinjaForms' Contracts email using CiviCRM's API v4

Method
getCiviObject protected
@inheritDoc
Method
constructParentNameValuePairs protected
@inheritDoc
Class

Event

Honors NinjaForms' Contracts event using CiviCRM's API v4

Method
getCiviObject protected
@inheritDoc
Method
getGetRecordsResponse protected
@inheritDoc
Class

Group

Honors NinjaForms' Contracts group using CiviCRM's API v4

Method
getCiviObject protected
@inheritDoc
Method
getGetRecordsResponse protected
@inheritDoc
Class

GroupContact

Honors NinjaForms' Contracts groupContact using CiviCRM's API v4

Method
getCiviObject protected
@inheritDoc
Method
constructParentNameValuePairs protected
@inheritDoc
Class

Im

Honors NinjaForms' Contracts IM using CiviCRM's API v4

Method
getCiviObject protected
@inheritDoc
Method
constructParentNameValuePairs protected
@inheritDoc
Class

LineItem

@inheritDoc

Method
constructLineItemForOrder public
@inheritDoc
Method
validateConstructedLineItem protected
Check for required construction, set HandledResponse flags
Return
void
Method
setValues protected
Set lineItem values from incoming parameters
Return
void
Method
validateParameters protected
Ensures required parameters are set
Param
array $parameterArray
Return
void
Method
initializeLineItemForOrder protected
Initialize the basic Line Item construct
Class

Note

Honors NinjaForms' Contracts note using CiviCRM's API v4

Method
getCiviObject protected
@inheritDoc
Method
constructParentNameValuePairs protected
@inheritDoc
Class

OptionGroup

Honors NinjaForms' Contracts OptionGroup using CiviCRM's API v4

Method
getCiviObject protected
@inheritDoc
Method
getGetRecordsResponse protected
@inheritDoc
Class

OptionValue

Honors NinjaForms' Contracts OptionValue using CiviCRM's API v4

Method
getCiviObject protected
@inheritDoc
Method
getGetRecordsResponse protected
@inheritDoc
Class

Order

Method
createOrder public
Class

Participant

Honors NinjaForms' Contracts participant using CiviCRM's API v4

Method
getCiviObject protected
@inheritDoc
Method
constructParentNameValuePairs protected
@inheritDoc
Class

Phone

Honors NinjaForms' Contracts phone using CiviCRM's API v4

Method
getCiviObject protected
@inheritDoc
Method
constructParentNameValuePairs protected
@inheritDoc
Class

Tag

Honors NinjaForms' Contracts tag using CiviCRM's API v4

Method
getCiviObject protected
@inheritDoc
Method
getGetRecordsResponse protected
@inheritDoc
Class

TagEntity

Honors NinjaForms' Contracts tagEntity using CiviCRM's API v4

Method
getCiviObject protected
@inheritDoc
Method
constructParentNameValuePairs protected
@inheritDoc
Class

Website

Honors NinjaForms' Contracts website using CiviCRM's API v4

Method
getCiviObject protected
@inheritDoc
Method
constructParentNameValuePairs protected
@inheritDoc
Class

CiviMockObject

Generic Civi Entity object that can be used as stand-in
If CiviCrm plugin is not installed, Ninja Form's form action would stall as it relies on Civi's entity objects for setup. By providing an option to use a mock object, Ninja Form's form action can be set up to a certain extent without Civi being installed. This class honors the contracts of all the implemented contracts specified by returning empty values of all requests.

See
\NinjaForms\CiviCrmSdk\Factories\CiviObjectsFactory

Method
getFields public
@inheritDoc
Method
create public
@inheritDoc
Method
getRecords public
@inheritDoc
Method
hasMatch public
@inheritDoc
Method
getMatchingId public
@inheritDoc
Method
getResponse public
@inheritDoc
Class

CiviMockObject

Method
getFields public
Get field definitions as indexed array of CiviFieldDefinition->toArray()
Return
array
Class

CiviMockObject

Method
create public
Create a new record of the object
Param
array $values Civi field 'name' => form value pairs
Param
array $parentIds Array keyed on entity=> (string) id
Return
CreateObjectResponse CreateObjectResponse
Method
getResponse public
Return the CreateObjectResponse
Return
CreateObjectResponse
Class

CiviMockObject

Method
getRecords public
Request records from CiviCrm
Records are returned as a indexed collection of associative arrays. The requestor is responsible for interpreting the returned data into its desired structure.
Return
array
Class

CiviMockObject

Method
contact public
Make Contract\Contact object
Return
ContractsContact
Method
contactType public
Make Contract\ContactType object
Return
ContractsContactType
Method
optionGroup public
Make Contract\OptionGroup object
Return
ContractsOptionGroup
Method
dedupeRuleGroup public
Make Contract\DedupeRuleGroup object
Return
ContractsDedupeRuleGroup
Method
optionValue public
Make Contract\OptionValue object
Return
ContractsOptionValue
Method
dedupeRule public
Make Contract\DedupeRule object
Return
ContractsDedupeRule
Method
activity public
Make Contracts\Activity object
Return
ContractsActivity
Method
event public
Make Contracts\Event object
Return
ContractsEvent
Method
note public
Make Contracts\Note object
Return
ContractsNote
Method
country public
Make Contracts\Country object
Return
ContractsCountry
Method
tag public
Make Contracts\Tag object
Return
ContractsTag
Method
participant public
Make Contracts\Participant object
Return
ContractsParticipant
Method
email public
Make Contracts\Email object
Return
ContractsEmail
Method
phone public
Make Contracts\Phone object
Return
ContractsPhone
Method
iM public
Make Contracts\Im object
Return
ContractsIm
Method
website public
Make Contracts\Website object
Return
ContractsWebsite
Method
address public
Make Contracts\Address object
Return
ContractsAddress
Method
group public
Make Contracts\Group object
Return
ContractsGroup
Method
groupContact public
Make Contract\GroupContact object
Return
ContractsGroupContact
Method
tagEntity public
Make Contract\TagEntity object
Return
ContractsTagEntity
Method
lineItem public
Make Contract\LineItem object
Return
ContractsLineItem
Method
order public
Make Contract\Order object
Return
ContractsOrder
Method
setBypassCivi public
Set boolean to bypass CiviCrm, using mocks
Param
bool $bypassCivi Boolean to bypass CiviCrm, using mocks
Return
CiviObjectsFactory
Class

CiviMockObject

Method
hasMatch public
Does contact have a match
Method
getMatchingId public
Return the matching contact id
Class

CiviMockObject

Method
constructLineItemForOrder public
Construct a line item request to be included in Order
Param
array $parameterArray
Return
array
Class

CiviMockObject

Method
createOrder public
Construct a line item request to be included in Order
Param
array $parameterArray
Return
array
Class

CiviFieldDefinition

Field definition for a CiviCRM field Uses CiviCRM property names

Method
getName public
Return
string
Method
getLabel public
Return
string
Method
getEntity public
Return
string
Method
isRequired public
Return
bool
Method
getDataType public
Return
string
Method
getInputType public
Return
string
Static Method
fromArray public
Method
__set public
Set defined properties
Class

CreateObjectResponse

Method
getId public
Get id of the created object
Return
string
Method
setId public
Set id of the created object
Param
string $id Id of the created object
Return
self
Method
getEntity public
Get entity of the created object
Return
string
Method
setEntity public
Set entity of the created object
Param
string $entity Entity of the created object
Return
self
Class

GetContactTypesResponse

Extend Records response with needed ContactTypes properties

Method
getName public
Get the value of name
Method
getLabel public
Get the value of label
Method
getDescription public
Get the value of description
Method
getImage_URL public
Get the value of image_URL
Method
getParent_id public
Get the value of parent_id
Method
getIs_active public
Get the value of is_active
Method
getIs_reserved public
Get the value of is_reserved
Class

GetCountriesResponse

Extend Records response with needed Country properties

Method
getName public
Get the value of name
Method
getIso_code public
Get the value of iso_code
Method
getCountry_code public
Get the value of country_code
Method
getAddress_format_id public
Get the value of address_format_id
Method
getIdd_prefix public
Get the value of idd_prefix
Method
getNdd_prefix public
Get the value of ndd_prefix
Method
getRegion_id public
Get the value of region_id
Method
getIs_province_abbreviated public
Get the value of is_province_abbreviated
Method
getIs_active public
Get the value of is_active
Class

GetDedupeRuleGroupsResponse

Extend Records response with needed DedupeRuleGroups properties

Method
getName public
Get the value of name
Method
getTitle public
Get the value of title
Method
getContactType public
Get the value of contact type
Method
getThreshold public
Get the value of threshold
Method
getUsed public
Get the value of used
Method
getIs_reserved public
Get the value of is_reserved
Class

GetDedupeRulesResponse

Extend Records response with needed DedupeRule properties

Method
getRuleTable public
Get the value of rule_table
Method
getDedupeRuleGroupId public
Get the value of dedupe_rule_group_id
Method
getRuleField public
Get the value of rule_field
Method
getRuleLength public
Get the value of rule_length
Method
getRuleWeight public
Get the value of rule_weight
Class

GetEventsResponse

Method
getTitle public
Get the value of title
Method
getSummary public
Get the value of summary
Method
getDescription public
Get the value of description
Class

GetGroupsResponse

Entity describing a collection of 'Group' records

Method
getName public
Get the value of name
Method
getTitle public
Get the value of title
Method
getDescription public
Get the value of description
Class

GetOptionGroupsResponse

Extend Records response with needed OptionGroups properties

Method
getName public
Get the value of name
Method
getTitle public
Get the value of title
Method
getDescription public
Get the value of description
Method
getDataType public
Get the value of data_type
Method
getParent_id public
Get the value of parent_id
Method
getIs_active public
Get the value of is_active
Method
getIs_reserved public
Get the value of is_reserved
Method
getIs_locked public
Get the value of is_locked
Class

GetOptionValuesResponse

Extend Records response with needed OptionValues properties

Method
getName public
Get the value of name
Method
getLabel public
Get the value of label
Method
getDescription public
Get the value of description
Method
getValue public
Get the value of value
Method
getOption_group_id public
Get the value of option_group_id
Method
getIs_active public
Get the value of is_active
Method
getIs_reserved public
Get the value of is_reserved
Class

GetRecordsResponse

Define an entity for a getRecords response
Each entity has field names specific to it, however they all have an id field, which is defined here. Specific entities extend this object with properties and methods to get the fields.

Method
getId public
Get id of the retrieved object
Return
string
Static Method
fromArray public
Method
__set public
Set defined properties
Return
GetRecordsResponse
Class

GetTagsResponse

Extend Records response with needed Tags properties

Method
getName public
Get the value of name
Method
getDescription public
Get the value of description
Class

CiviObjectsFactory

Provides entity objects for CiviCrm plugin requests
If a bypass is not requested, provides the entity objects used to make requests of CiviCrm plugin. If bypassing is requested, such as when CiviCrm plugin is not active, this factory provides a mock version that returns empty data.

Method
activity public
@inheritDoc
Method
event public
@inheritDoc
Method
note public
@inheritDoc
Method
country public
@inheritDoc
Method
contactType public
@inheritDoc
Method
optionGroup public
@inheritDoc
Method
dedupeRuleGroup public
@inheritDoc
Method
optionValue public
@inheritDoc
Method
dedupeRule public
@inheritDoc
Method
tag public
@inheritDoc
Method
contact public
@inheritDoc
Method
email public
@inheritDoc
Method
phone public
@inheritDoc
Method
iM public
@inheritDoc
Method
website public
@inheritDoc
Method
address public
@inheritDoc
Method
participant public
@inheritDoc
Method
group public
@inheritDoc
Method
groupContact public
@inheritDoc
Method
tagEntity public
@inheritDoc
Method
lineItem public
@inheritDoc
Method
order public
@inheritDoc
Method
setBypassCivi public
Set boolean to bypass CiviCrm, using mocks
Param
bool $bypassCivi Boolean to bypass CiviCrm, using mocks
Return
ContractsCiviObjectsFactory
Class

Master

Master class for CiviCrm SDK

Method
registerServices public
@inheritDoc
Class

function

Class

AjaxHandler

Method
__construct public
Construct with rootDirectory
Param
string $rootDirectory
Method
handle public
Receive request and return response @inheritDoc This abstract requires child methods to process the request and return a keyed array of response values, which this parent structures and returns to the JS script.
Return
void
Method
processAjaxRequest protected
Method
initializeLocalizedArray protected
Method
setScriptUrl protected
Set the script URL
Script URL is defined by the child class and is given as a relative directory and includes file extension; usually we store such JS files in assets/js. This protected method constructs the full URL on ->handle() and is done by the parent class.
(
ex: 'assets/js/nfpluginsettings.js'
)
Method
end protected
End AJAX handler per WP's requirements
Passing data back to the JS script ends with echoing a JSON string and calling the die() function. This is handled automatically by the parent class, leaving the child to focus on constructing and return an associative array of the returned values.
Param
array $returnParams
Return
void
Method
getPostData protected
Filter and return POST data for supplied keys
An AJAX request is triggered by a POST call. This class extracts the requested data from that POST call. A child class can put the following code in its implementation of the processAjaxRequest() method to easily extract the data it wants: ``` $keys = [ 'wpRestNonce', 'context' ];
$postData = $this->getPostData($keys);
\extract($postData); ```
The data will now be available as `$wpRestNonce` and `$context`
Param
array $keys
Return
array
Method
getHandle public
@inheritDoc
Method
getScriptUrl public
@inheritDoc
Method
getVersion public
@inheritDoc
Method
getObjectName public
@inheritDoc
Method
getLocalizedArray public
@inheritDoc
Class

FilterSettingsOutput

Method
__construct public
Method
handle public
Modify plugin settings at time of render
Return
FilterSettingsOutput
Method
modifyConfiguredSettings protected
Method
filter public
Modify configured settings at time of output
Param
array $incomingSettings
Return
array
Class

FormActionProcessor

Method
__construct public
Construct with action configuration array
Param
array $actionConfiguration Action configuration array
Method
getActionConfiguration public
Return the action configuration array
Method
process public
@inheritDoc
Method
finalizeActionSettings public
Modify and return the action settings at run time If this method appears in a child object, then the default functionality is being overridden, in which the action configuraion settings are being modified at run time
Return
void
Method
processSubmissionData abstract
Process the submission data, (optionally) update NF form process $data as $this->data
Return
void
Method
extractSubmissionData protected
Extract submission data as defined by the action configuration
Stores value in $this->submissionData
Param
array $action_settings
Return
FormActionProcessor
Method
save public
@inheritDoc
Class

Master

Method
registerServices public
Method
setRootDirectory public
Set root directory for the file and associated Configure class
Param
string $rootDir
Return
Master
Method
registerPluginSettings public
Method
registerAdvancedSettings public
Method
registerAction public
Registers a form action with NF Core
Param
FormAction $formAction
Return
Master
Method
configure protected
Method
getRootDirectory public
Get root directory
Return
string
Class

SimpleEntity

Simple entity abstract upon which all entities are built
Entities are classes that pass well defined data honoring contracts. Single parameters and arrays, when passed into an entity, can be relied upon to provide the data defined by the entity, even if the original data did not fully define values.

Method
toArray public
Constructs an array representation
Method
jsonSerialize public
Sets data for json_encode
Return
void
Class

SubmissionMetabox

Method
__construct public
Method
render_metabox public
Output the metabox as called by NF Core
Param
[type] $post
Param
[type] $metabox
Return
void
Method
outputHandledResponse protected
Method
outputActionHeading protected
Method
addNoResponseDataMarkup protected
Class

SubmissionMetabox

Method
handle public
Call methods to handle AJAX requests from settings page This method is registered as the AJAX callback, thus the POSTed request from the AJAX script is sent here. Implementations can then trigger whatever tasks must be performed and return the corresponding response.
Method
getHandle public
Get AJAX script handle
Return
string
Method
getScriptUrl public
Get URL of script
Return
string
Method
getVersion public
Get script version
Return
string
Method
getObjectName public
Get object name of the JS object
Return
string
Method
getLocalizedArray public
Get key value pairs of data passed into JS object
Return
$params
Class

SubmissionMetabox

Method
columnsFromCollection public
Provide multi-dim array - indexed=>keyed Given an indexed array of associative arrays, returns indexed array of associative arrays containing only the specified keys. Collection requests often include full entity definitions, but we may need only a couple of keys within that full definition. This method iterates through each item in the collection to validate the data in process rather than some more powerful array functions because this method cannot be certain of the data's validity. [ {key1=>val1a, key2=>val2a, key3=>val3a }, {key1=>val1b, key2=>val2b, key3=>val3b } ... ]
Param
array $collection
Param
array $keys
Return
array
Method
keyValuePairsFromCollection public
Provide key value pair from a multidimentional array Given an indexed array of associative arrays, returns key value pairs of data within each element
Param
array $collection
Param
array $keys
Return
array
Method
labelValuePairsFromCollection public
Provide label-value pairs as indexed arrays This is the structure used by NF core to construct such features as select options. Given an indexed array of associative arrays, returns indexed array of label-value pairs.
Param
array $collection
Param
string $label Key containing the indended label
Param
string $value Key containing the intended value
Return
array
Class

SubmissionMetabox

Method
getActionConfiguration public
Return the action configuration array
Method
finalizeActionSettings public
Modify and return the action settings at run time
Return
void
Method
process public
Process the submitted form, returning updated $data
Param
array $action_settings
Param
type $form_id
Param
array $data
Method
save public
Modify the action settings at time of form save
Var
array $action_settings Form action settings before save
Return
array Form action settings modified for saving
Class

SubmissionMetabox

Method
getLogCollection public
Load the existing log collection from transient
Method
clearLog public
Clear the log's storage location
Class

SubmissionMetabox

Method
registerPluginSettings public
Register plugin settings with NF core
Param
string $configFilename
Return
string Filter tag for modifying registered settings
Method
registerAdvancedSettings public
Register advanced settings with NF core
Param
string $configFilename
Return
string Filter tag for modifying registered settings
Method
registerServices public
Register Services
Return
Master
Class

SubmissionMetabox

Method
keyValuePairs public
Provide Key => Value pairs markup
Used when integration requires a programmatic key instead of the human-readable form, this output highlights the key such that the user can readily get the needed value; the value is not highlighted because that is not the intended data, although eyes will be naturally drawn to it as it is recognizable.
Param
array $idValues
Return
string
Method
tableColumns public
Output a table of multidimensional array
Given indexed array of arrays, outputs a table, a row for each indexed array, a cell for each element within that array
Param
array $array
Param
integer|null $columnCount
Return
string
Method
markupButton public
Markup button with id and button text
Param
string $buttonText
Return
string
Class

SubmissionMetabox

Method
setUrl public
Set HTTP request URL
Param
string $url
Return
\SaturdayDrive\EmailCRM\AmoCrm\Handlers\RemoteRequest
Method
setHttpArg public
Set an HTTP argument
Param
string $arg
Param
mixed $value
Return
RemoteRequest
Method
addQueryArg public
Set an HTTP argument
Param
string $arg
Param
mixed $value
Return
RemoteRequest
Method
setBody public
Set HTTP request body
Param
mixed $body
Return
RemoteRequest
Method
setHeaderParameter public
Set an HTTP header parameter
Param
string $arg
Param
mixed $value
Return
RemoteRequest
Method
handle public

Return
HandledResponse
Class

SubmissionMetabox

Method
handle public
Given template name and option repeater columns, constructs template script
Param
string $templateName
Param
array $columns
Return
string
Class

AdvancedSetting

Single plugin setting in form design's Advanced section

Package
Settings

Method
getName public
Return Advanced setting Name
Return
string
Method
getLabel public
Return Advanced setting label
Return
string
Method
getType public
Return Advanced setting data type
Return
string
Method
getWidth public
Return Advanced setting width
Return
string
Method
getGroup public
Return Advanced setting group
Return
string
Method
getTemplateRow public
Return Advanced setting template row
Return
string
Method
getColumns public
Return Advanced setting columns
Return
string
Method
getValue public
Get the value for the AdvancedSetting
Return
mixed
Method
setName public
Set Advanced setting Name
Param
string $stringValue
Return
AdvancedSetting
Method
setLabel public
Set Advanced setting label
Param
string $stringValue
Return
AdvancedSetting
Method
setType public
Set Advanced setting expected data type
Param
string $stringValue
Return
AdvancedSetting
Method
setWidth public
Set Advanced setting width
Param
string $stringValue
Return
AdvancedSetting
Method
setGroup public
Set Advanced setting Group
Param
string $stringValue
Return
AdvancedSetting
Method
setTemplateRow public
Set Advanced setting template row
Param
string $stringValue
Return
AdvancedSetting
Method
setColumns public
Set Advanced setting column
Param
array $arrayValue
Return
AdvancedSetting
Method
setValue public
Set the value for the AdvancedSetting
Param
type $param
Static Method
fromArray public
Method
__set public
Set defined properties
Class

AdvancedSettings

Describes a collection of Advanced Setting entities

Package
Settings

Method
getId public
Return Advanced settings Id
Return
string
Method
getNicename public
Return Advanced setting nicename
Return
string
Method
setId public
Set Advanced setting Id
Param
string $stringValue
Return
AdvancedSettings
Method
setLabel public
Set Advanced setting label
Param
string $stringValue
Return
AdvancedSettings
Static Method
fromArray public
Method
toArray public
Convert AdvancedEttings object into associative array
Return
array
Method
addAdvancedSetting public
Add an Advanced Setting to collection
Param
AdvancedSetting $advancedSetting
Return
AdvancedSettings
Method
getAdvancedSetting public
Get a Plugin Setting from collection
Param
string $key
Return
AdvancedSetting
Throws
Exception
Method
getAdvancedSettings public
Get all Plugin Settings in collection
Return
AdvancedSetting[]
Method
getAdvancedSettingsArray public
Get all Plugin Settings as keyed array of AdvancedSetting arrays
Return
array
Method
__set public
Set defined properties
Class

HandledResponse

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

Method
setContext public
Set the context

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

PluginSetting

Single plugin setting in NF Settings This entity describes a piece of data that the plugin requires. NF is responsible for storing and delivering this entity.

Package
Settings

Method
getId public
Return Plugin setting Id
Return
string
Method
getLabel public
Return Plugin setting label
Return
string
Method
getType public
Return Plugin setting data type
Return
string
Method
getHtml public
Return Plugin setting html
Return
string
Method
getValue public
Get the value for the PluginSetting
Return
mixed
Method
setId public
Set Plugin setting Id
Param
string $stringValue
Return
PluginSetting
Method
setLabel public
Set Plugin setting label
Param
string $stringValue
Return
PluginSetting
Method
setType public
Set Plugin setting expected data type
Param
string $stringValue
Return
PluginSetting
Method
setHtml public
Set Plugin setting HTML
Param
string $stringValue
Return
PluginSetting
Method
setValue public
Set the value for the PluginSetting
Param
type $param
Static Method
fromArray public
Method
__set public
Set defined properties
Class

PluginSettings

Describes a collection of Plugin Setting entities

Package
Settings

Method
getId public
Return Plugin settings Id
Return
string
Method
getLabel public
Return Plugin setting label
Return
string
Method
setId public
Set Plugin setting Id
Param
string $stringValue
Return
PluginSettings
Method
setLabel public
Set Plugin setting label
Param
string $stringValue
Return
PluginSettings
Static Method
fromArray public
Method
toArray public
Convert PluginSettings object into associative array
Return
array
Method
addPluginSetting public
Add an Plugin Setting to collection
Param
PluginSetting $pluginSetting
Return
PluginSettings
Method
getPluginSetting public
Get a Plugin Setting from collection
Param
string $key
Return
PluginSetting
Throws
Exception
Method
getPluginSettings public
Get all Plugin Settings in collection
Return
PluginSetting[]
Method
getPluginSettingsArray public
Get all Plugin Settings as keyed array of PluginSetting arrays
Return
array
Method
__set public
Set defined properties
Class

ActionRegistrar

Registers a form action, given a FormAction class Also calls standard builder templates

Method
handle public
Registers a new plugin action
Return
void
Method
registerCss public
Register CSS for form builder if on form builder page
Caller verifies that cssFilename is set before calling because this method is hooked into admin_init and there is no need to hook if no CSS is specified for loading. Check for admin page is done here because admin_init ensures that page URl is established.
Return
void
Method
builderTemplates public
Loads a template for admin display
Return
void
Method
setRootDirectory public
Set root directory
Param
string $rootDirectory
Return
ActionRegistrar
Method
setTemplateAutobuilder public
Set template Autobuilder
Param
TemplateAutobuilder $templateAutobuilder
Return
ActionRegistrar
Class

AdvancedSettingsRegistrar

Registers settings for forms' Advanced Provides a filter tag and passes the configured data such that methods calling the tag can modify the configured settings at run time.

Method
__construct public
Construct with Settings Group and Settings arrays
Param
array $settingsGroupArray
Param
array $settingsArray
Method
handle public
Register the configured settings with NF core Also passes data to a filter at run time
Return
AdvancedSettingsRegistrar
Method
addAdvancedSettingsGroup public
Add configured settings group to the NF groups
Param
array $groups
Return
array
Method
addAdvancedSettings public
Add configured settings to the gropu
Param
array $settings
Return
array
Method
wrapAddNew protected
Add the markup to Add New option repeater entries This is a helper function. Option repeaters require this markup for the JS builder to add the Add New UI. Given the string of option repeater text, this method adds the necessary markup.
Param
array $advancedSetting
Return
array
Method
builderTemplates public
Loads a template for admin display
Return
void
Method
setRootDirectory public
Set root directory
Param
string $rootDirectory
Return
AdvancedSettingsRegistrar
Method
getFilterTag public
Get tag used to filter settings
Return
string
Class

AjaxRegistrar

Method
__construct public
Method
initializeScripts public
Load, enqueue, localize scripts
Class

Configure

Load configuration files as arrays and present on demand
Instantiated with a plugin's root directory, Configure has a method called `configure` that accepts the name of a configuration file stored in the root directory's `Config` folder. By default, it will look for a php file delivering an array, but an optional parameter for extension enables the use of a JSON file, which will be converted into an array. The file is loaded once and stored such that future requests for the same configuration do not need an additional file load.

Method
__construct public
Method
configure public
Return a configured array, storing configuration for reuse
Param
string $configurationName
Param
string|null $extension
Return
array
Class

Container

Basic service container

Method
doesProvide public
@inheritdoc
Method
bind public
@inheritdoc
Method
make public
@inheritdoc
Method
isUnBoundSingleton private
Method
singleton public
Method
resolve private
Resolve dependencies.
Param
$class
Return
object
Method
has public
Method
bound public
Determine if the given abstract type has been bound.
Param
string $abstract
Return
bool
Method
isAlias public
Determine if a given string is an alias.
Param
string $name
Return
bool
Class

DataModelProvider

Provides standard data model structures API requests have some common structures when delivering data, and NF diagnostics have common structures for presenting that data for support. This class enables standardization by taking known data inputs and structuring them for known data outputs.

Method
columnsFromCollection public
@inheritDoc
Method
keyValuePairsFromCollection public
@inheritDoc
Method
labelValuePairsFromCollection public
@inheritDoc
Class

ExtraDataHandler

Standardized methods for adding "extra" submission data
Actions, during the submission process, have the opportunity to add additional data ("extra") to the submitted data, which can not only be stored, but also used by downstream actions. This class provides a standardized method for storing and retrieving such data.

Package
FormProcessing

Method
__construct public
Construct with incoming data and an action key
The action key is the id of the action. All extra data for a given action is stored under this key.
Param
array $data Data array provided at process time
Param
string $actionKey Action Id
Method
appendHandledResponse public
Append HandledResponse array to form process data
Data is stored as a _collection_ of HandledResponse arrays because any given action can make multiple requests. In addition, because there can be more than one of the same action on a form, the option is given to key each instance of the action. Thus the data can store multiple instances of actions under individual keys, and store a collection of HandledResponses under those.
Data is structured as a HandledResponse array. By having a common entity structure, the end user of the stored data can convert the data into an entity and rely on known methods and data types.

Param
array $handledResponse Entity as an array
See
NinjaForms\CiviCrmShared\Entities\HandledResponse
Method
overrideExtraData public
Completely re-write of the action key's extra data
This can be used to write the action data in one request, or to complete remove the extra data for the action key
Param
array|null $override
Return
ExtraDataHandler
Method
setData public
Set nF Process Data passed to action
Param
array $data NF Process Data passed to action
Return
self
Method
getData public
Return complete NF process `$data` for passing back to form processing
Return
array Complete form processing data
Class

FormAction

Form action object Initialized with a configuration array and a Form Actions Processor. The config defines parameters to initialize the form action. The processor handles functionality unique to the action, such as modifying the action settings, processing the submission, appending data to the form submissions' data

Method
__construct public
Method
finalizeSettings public
Adjust action settings at run time
Return
void
Method
save public
@inheritDoc
Method
process public
Process the submitted form
Param
array $action_settings
Param
type $form_id
Param
array $data
Method
get_name public
Return action name
Return
string
Method
getActionCssFilename public
Returns custom form builder CSS filename relative to root NOTE: full name including extension relative to the root directory Returns empty string if not set
Return
string
Class

NfAdminMarkup

Provide standardized markup for settings output Many integrating plugins share common data structures that can be presented to the form designer for effective form setup. This class provides standard markup for display on the NF Settings page. Ultimately this could be replaced with a template or migrated to React JS, but this will help define the UX we need for effective customer guidance towards the form design they wish.

Method
keyValuePairs public
@inheritDoc
Method
tableColumns public
@inheritDoc
Method
markupButton public
@inheritDoc
Method
spanMarkup protected
Wraps provided content with span tags, optional class and id
Param
string $data
Param
string|null $elementId
Param
string|null $class
Return
string
Method
idMarkup protected
Markup id, when id is optional
Param
string|null $id
Return
string
Method
classMarkup protected
Markup class, when class is optional
Param
string|null $class
Return
string
Class

PluginSettingsRegistrar

Method
__construct public
Construct with Settings Group and Settings arrays
Param
array $settingsGroupArray
Param
array $settingsArray
Method
handle public
Method
addPluginSettingsGroup public
Add configured settings group to the NF groups
Param
array $groups
Return
array
Method
addPluginSettings public
Add configured settings to the gropu
Param
array $settings
Return
array
Method
getFilterTag public
Get tag used to filter settings
Return
string
Class

TemplateAutobuilder

@inheritDoc

Method
handle public
@inheritDoc
Method
openScript protected
Open script tag with icon for handle
Return
void
Method
appendColumnScripts protected
Add each column as a template, based on column type
Single column version; each column is on its own row with a line break in between.
Return
void
Method
closeScript protected
Close script with delete icon and closing script tag
Return
void
Class

TransientLogger

Provides logging to a transient stored in WP table for one week

Method
__construct public
Construct with transient key
Param
string $transientKey
Method
log public
Logs with an arbitrary level.
Param
mixed $level
Param
string $message
Param
mixed[] $context
Return
void
Throws
\Psr\Log\InvalidArgumentException
Method
storeLogCollection protected
Store the log as a transient for one week
Method
getLogCollection public
@inheritDoc
Method
clearLog public
@inheritDoc
Method
constructLogEntry protected
Get the current log from the transient
Return
array
Class

WpRemoteRequest

Make an HTTP request using wp_remote_request

Method
__construct public
Make an HTTP request to return a response array
Method
setUrl public
Method
setHttpArg public
Method
addQueryArg public
Method
setBody public
Method
setHeaderParameter public
Method
finalizeRequest protected
Method
handle public

Return
HandledResponse
Method
setDefaultHttpArgs protected
Set default arguments
Class

WpRemoteRequest

Method
nf_civicrm_plugins_loaded
Method
nf_civicrm_setup_license
Class

InitLate

Bootstrap functionality hooked at init priority 15
Default priority is 10; this runs after all init functions not explicitly prioritized.
The bootstrap file calls this class with an action hook at 'init' priority 15. This enables anything in the class to run after any init hooks not explicitly prioritized after init 15. This can be used for situations where other plugins must be loaded and initialized before the functionality contained herein.

Package
Initializing

Method
__construct public
Method
pluginSettings protected
Register plugin setings and filter output
Plugin settings are initialized from a configured array using the PluginSettingsRegistrar. A FilterSettingsOutput class, which extends a shared abstract class, is instantiated and gets passed those plugin settings at run time, enabling it to dynamically adjust the configured array values. Finally, an NfPluginSettingsAjax class, which extends a shared abstract class, activates AJAX functionality for the plugin settings using a standardized hook and enqueuing.

See
\NinjaForms\CiviCrmShared\Handlers\PluginSettingsRegistrar
See
\NinjaForms\CiviCrm\Handlers\FilterSettingsOutput
See
\NinjaForms\CiviCrm\Handlers\NfPluginSettingsAjax
Class

Method
preRegistrationCheck protected
Check that any required external functionality is present
For example, if other plugins are required, perform a check here; The plugins may be active, but may not have initialized fully, so ensure that the required specific functionality is available. If it is not yet available, move the dependent method to a later action hook.
Since CivCrmSdk has added a 'bypass' function, we don't have to stop functionality, instead we set the bypass that tells CiviCrmSdk to provide the mock object instead of actual CiviObjects.
Class

PluginsLoadedEarly

Bootstrap functionality hooked at plugins_loaded priority 5
Runs before any plugins_loaded hooks not explicitly prioritized earlier than 5. The bootstrap file calls this class with an action hook at 'plugins_loaded' priority 5. This enables anything in the class to run before any hooks not explicitly prioritized before plugin_loaded 5. This can be used for situations where the functionality container herein must be present for downstream classes.

Package
Initializing

Method
__construct public
Instantiate with a master class Factory class is made to produce runtime dependencies
Param
Master $master
Method
registerActions public
Register plugin actions
Create a FormAction class and pass it into master class's registerActions method
Return
void
Method
registerSubmissionMetaboxes public
Instantiate the submission metabox
See
\NinjaForms\CiviCrm\Handlers\SubmissionMetabox
Return
void
Method
preRegistrationCheck protected
Check that any required external functionality is present
For example, if other plugins are required, perform a check here; The plugins may be active, but may not have initialized fully, so ensure that the required specific functionality is available. If it is not yet available, move the dependent method to a later action hook.
In this plugin, there is currently no pre-Registration check required, but process flow is kept to ensure that it can easily be added with minimal change after initial release.
Class

PluginsLoadedEarly

Method
getFieldDefinitionIdLabelPairs public
Get Id Label pairs for the entity
Id-label pairs can be id=>label associative array by default, or as an indexed array [ 'value'=>$id, 'label'=>$label ], The indexed array is the construct used when create NF select options
Return
array
Class

PluginsLoadedEarly

Method
getRecords public
Get array of all Events
Return
array
Class

PluginsLoadedEarly

Method
contact public
Provide Contact Data Access object
Return
DataAccessContact
Method
activity public
Provide Activity Data Access object
Return
DataAccessActivity
Method
event public
Provide Event Data Access object
Return
DataAccessEvent
Method
note public
Provide Note Data Access object
Return
DataAccessNote
Method
tag public
Provide Tag Data Access object
Return
DataAccessTag
Method
email public
Provide Email Data Access object
Return
DataAccessEmail
Method
phone public
Provide Phone Data Access object
Return
DataAccessPhone
Method
iM public
Provide Im Data Access object
Return
DataAccessIm
Method
participant public
Provide Participant Data Access object
Return
DataAccessParticipant
Method
address public
Provide Address Data Access object
Return
DataAccessAddress
Method
group public
Provide Group Data Access object
Return
DataAccessGroup
Method
groupContact public
Provide GroupContact Data Access object
Return
DataAccessGroupContact
Class

PluginsLoadedEarly

Method
getRecords public
Get array of all Groups
Return
array
Class

PluginsLoadedEarly

Method
getRecords public
Get array of all Tags
Return
array
Class

PluginsLoadedEarly

Method
process public
Process the form submission data
Return
ModuleProcessor
Method
setSubmissionData public
Set submission Data array
Param
array $submissionData Submission Data array
Return
ModuleProcessor
Method
setRecordIds public
Set array of previously constructed (or matched) Ids
Param
array $recordIds Array of previously constructed (or matched) Ids
Return
ModuleProcessor
Method
getRecordIds public
Get array of previously constructed (or matched) Ids
Return
array
Method
getResponses public
Get collection of CreateObjectResponse objects
Return
CreateObjectResponse[]
Method
isDupe public
Is this processing a previously matched duplicate?
Indicates if the processor will be working on a previously matched duplicate. Important because some processors, like an email, won't run if previously matched on an email.
Return
boolean
Method
setIsDupe public
Sets bool - is this processing a previously matched duplicate
Param
boolean|null $isDupe
Return
ModuleProcessor
Class

PluginsLoadedEarly

Method
getObject public
Return current ModuleProcessor
Param
int $position
Return
ModuleProcessor|null
Method
addObject public
Add a Module Processor to the collection
Param
ModuleProcessor $moduleProcessor
Return
ModuleProcessorCollection
Class

PluginsLoadedEarly

Method
getModuleProcessors public
Class

Activity

Method
__construct public
Class

Address

Method
__construct public
Class

Contact

Method
__construct public
Class

DataAccessAbstract

Method
__construct public
Method
getFieldDefinitionIdLabelPairs public
Get Id Label pairs for the entity
ID = name for a given field
Return
array
Method
constructIdLabelPairs protected
Construct the Id Label pairs
Return
void
Method
initializeFields protected
Class

Email

Method
__construct public
Class

Event

Method
__construct public
Method
getRecords public
Class

Group

Method
__construct public
Method
getRecords public
Get Group records
Return
array
Class

GroupContact

Method
__construct public
Class

Im

Method
__construct public
Class

Note

Method
__construct public
Class

Participant

Method
__construct public
Class

Phone

Method
__construct public
Class

Tag

Method
__construct public
Method
getRecords public
Class

Website

Method
__construct public
Class

DataAccessFactory

Provide DataAccess objects per Contract

Method
__construct public
Method
contact public
@inheritDoc
Method
activity public
@inheritDoc
Method
event public
@inheritDoc
Method
tag public
@inheritDoc
Method
participant public
@inheritDoc
Method
email public
@inheritDoc
Method
phone public
@inheritDoc
Method
iM public
@inheritDoc
Method
website public
@inheritDoc
Method
note public
@inheritDoc
Method
address public
@inheritDoc
Method
group public
@inheritDoc
Method
groupContact public
@inheritDoc
Class

MasterFactory

Instantiates and provides requested objects
Primarily this factory is used for objects that require complex construction dependent on other classes, or require runtime-only construction.

Method
__construct public
Construct with a configure object and CiviCrm Factory
Param
Configure $configure
Param
CiviObjectsFactory $civiObjectsFactory
Method
createContactFormAction public
Construct CreateChainedContacts form action
Return
FormAction
Method
createOrderAction public
Construct CreateOrder form action
Return
FormAction
Method
submissionMetaboxCreateEntries public
Constructs object that outputs submission metabox
Return
SubmissionMetabox
Method
dataAccessFactory public
Provide DataAccessFactory
Return
ContractsDataAccessFactory
Method
verifyDbConnection public
Construct VerifyDbConnection object
Return
VerifyDbConnection
Method
moduleProcesorFactory protected
Construct ModuleProcessorFactory
Return
ModuleProcessorFactory
Method
constructCreateContactActionConfiguration protected
Consolidate the action settings required for the CreateChainedContact action Each
Method
constructCreateOrderActionSettings protected
Merge CreateOrder settings into single ActionSettings configuration
Method
setBypassCivi public
Set boolean to bypass CiviCrm, using mocks
Param
bool $bypassCivi Boolean to bypass CiviCrm, using mocks
Return
MasterFactory
Class

ModuleProcessorFactory

Method
__construct public
Method
getModuleProcessors public
Provide a collection of Module Processors Constructs required form processors in processing order
Return
ContractsModuleProcessorCollection
Class

FilterSettingsOutput

Modify the configured plugin settings
By extending the shared abstract class, this class is responsible for a single method `modifyConfiguredSettings` to dynamically alter the plugin settings. This class creates a collection of UI buttons which, when coupled with the AJAX handler class, provides single page UI functionality.

Package
Settings

Method
__construct public
Construct with filter tag and Markup object
Param
string $filterTag
Param
NfAdminMarkup $markup
Method
modifyConfiguredSettings protected
@inheritDoc
Method
markupButtonControls protected
Add buttons to Settings page
Class

ModuleProcessorCollection

Collection of ModuleProcessors

Method
getObject public
@inheritDoc
Method
addObject public
@inheritDoc
Method
count public
Return count of objects in collection
Return
integer
Method
current public
Return current module processor
Return
ModuleProcessor
Method
next public
Move to next ModuleProcessor
Return
void
Method
key public
Return current index position in collection
Return
integer
Method
valid public
Ensure element at current position is a valid object of the aggregate
Return
boolean
Method
rewind public
Move pointer back to initial position
Return
void
Class

NfPluginSettingsAjax

Provide AJAX functionality for the plugin settings Functionality provided includes: 1. Button click to toggle diagnostics view 2. Button click to verify DB connectivity 3. Button click to display available events 4. Button click to display available groups 5. Button click to display available tags 6. Button click to display log

Method
__construct public
Handle AJAX calls on NF Plugin Settings page
Param
string $rootDirectory
Param
VerifyDbConnection $verifyDbConnection
Param
DataAccessEvent $dataAccessEvent
Param
DataModelProvider $dataModelProvider
Param
NfAdminMarkup $nfSettingsMarkup
Param
LoggerInterface $logger
Method
initializeLocalizedArray protected
Initialize data sent to JS with a nonce and current `showDiagnostics` preference
Generate and pass a nonce tagged with this class's (string) handle. Also, this retrieves the stored NF setting of a boolean value on whether to display or hide the diagnostics.
Method
processAjaxRequest protected
Process the AJAX request, returning keyed array
Expecting keyed values for wpRestNonce, context, and showDiagnostics. After verifying nonce, this method uses the context to switch among the allowed functionality; in this case, the options are to toggle the diagnostics, verify the database connect, and retrieve events.
Method
markupLog protected
Markup log for settings page output
Because timestamp values are not unique, it cannot be used as a key for the key->value standardized markup. This method provides similar markup and may get standardized into the Shared folder if it becomes use in multiple locations.
Param
array $log
Return
string
Class

SubmissionMetabox

Add SubmissionMetabox to output ExtraDataHandler data
This class iterates through each each of the HandledResponses to output the information into the submission metabox.

See
NinjaForms\CiviCrmShared\Handlers\ExtraDataHandler

Method
__construct public
@inheritDoc
Method
outputHandledResponse protected
Output the pertinent handled response data for a given response
Param
array $handledResponse
Return
string
Method
successfulResponseOutput protected
Markup HTML for a successful submission response
Param
HandledResponse $objectResponse
Return
string
Method
outputActionHeading protected
Output the action heading, with plural text option
Return
string
Method
addNoResponseDataMarkup protected
@inheritDoc
Class

VerifyDbConnection

Verifies DB connection by retrieving a contact field definition

Method
__construct public
Method
handle public
Run verification process
Return
VerifyDbConnection
Method
verified public
Return boolean - is connection verified?
Return
boolean
Method
getProof public
Get connection proof - key value pairs Returns key-value pairs of a contact field definition
Return
array
Method
getVerificationDescription public
Class

Master

Master class for Ninja Forms CiviCrm
The Master class is the primary class for a given package. The plugin will have a master class and packages such as an internal SDK for integration can also have its own master class, depending on the complexity.
The Master class extends the abstract Master class in the Shared directory; the abstract class standardizes common functionality such as registering plugin settings or advanced form settings. In doing so, the package developer can focus on the specific plugin functionality.
The `registerServices` method uses a Container to register and provide dependent classes downstream. In certain cases, such as complex class construction, classes requiring run-time construction, or a large family of similar classes, this class can register a factory, which then delivers the other classes as requested.

Method
registerServices public
@inheritDoc
Class

Class

function

Class

Class

Class

ActivityProcessor

Method
__construct public
Construct

Param
SdkObject $sdkObject
Param
DataModelProvider $dataModelProvider
Param
LoggerInterface $logger
Method
process public
@inheritDoc
Class

AddressProcessor

Method
__construct public
Construct
Param
SdkObject $sdkObject
Param
LoggerInterface $logger
Method
process public
@inheritDoc
Method
extractSubmissionData protected
Extract field mapping data from SubmissionData
Where a key substitute is required (ex:a key structure we don't want to use as a select field lookup key), the lookup values replace our safe value with the API's value.
Return
array
Class

ContactProcessor

Method
__construct public
Construct
Param
SdkObject $sdkObject
Method
process public
@inheritDoc
Class

'_process'

Method
createNewContact protected
Create a new contact from submission data
Return
void
Method
constructFieldMapping protected
Construct contact field mapping from dataModelProvider
Return
array
Method
contactDedupe protected
Class

CreateChainedContact

Create CiviCRM Contact with chained child objects ### Functionality ### 1. Create a new Contact 2. Create multiple emails linked to Contact using pre-defined 'location names' 3. Create multiple address linked to Contact using pre-defined 'location names' 4. Create a new Activity linked to Contact 5. Subscribe contact to a group 6. Add tags to contact and activity 7. Add line items for events and memberships 8. Add participants directly to free events 9. Add note to contact or participant 10. Uniquely identify contact when creating multiple contacts on same form 11. Option to disable storage of communication diagnostics data (not the actual submission data)

Package
FormProcessing

Method
__construct public
Construct
Param
array $actionConfiguration
Param
ContractsCiviObjectsFactory $civiObjectsFactory
Param
DataModelProvider $dataModelProvider
Param
ExtraDataHandler $extraDataHandler
Param
ModuleProcessorFactory $moduleProcessFactory
Param
LoggerInterface $logger
Method
finalizeActionSettings public
Override the parent's action settings with runtime values
Update the field map drop down values with constructed values from Civi Objects. CiviCrm is not initialized by the time the action settings must be registered, so only get the field values when the actual output is being generated in a form build. The dataModelProvider class handles the structuring of the data.
See
\NinjaForms\CiviCrmShared\Contracts\DataModelProvider
Return
array
Method
finalizeContactFields protected
Populate contact fields
Return
void
Method
finalizeContactTypes protected
Populate contact type and subtype
types/subtypes contained in one object; differentiator is presence of a parent_id, which designates it as a sub type
Return
void
Method
finalizeAddressFields protected
Adds select options with common name label and ISO country code value
Not currently used; this option was switched out to enable merge tags to set value; this option can be used if a hard-coded mapping is required
Return
void
Method
finalizeActivityFields protected
Populate activity fields
Return
void
Method
modifyActivityFieldMap protected
Retrieve label value pairs for all Activity fields, except status and type
Return
void
Method
modifyActivityLookups protected
Populate the Actity Stype dropdown with available statuses (sp?) for Contacts
Return
void
Method
findActivityGroupIds protected
Get OptionGroup Ids for activity type and status
Return
array Indexed array of [activityTypeGroupId,activityStatusGroupId]
Method
findActivityLookups protected
Finds lookups for Activity type and status
Return
array Indexed array of [ activityTypeNameLabel, activityStatusNameLabel]
Method
finalizeCreateGroupContact protected
Populate group dropdown select values
Return
void
Method
finalizeCreateEntityTag protected
Populate tag field map as dropdown
Return
void
Method
finalizeContactMatchOptions protected
Populate ContactMatchOptions with DedupeRuleGroups for `Individuals`
Return
void
Method
findDedupeRuleGroupsForIndividuals protected
Returns collection of DedupeRuleGroup where contact type is Individual
Returns indexed array of DedupeRuleGroup-as-associative array. Each element is ensured to have `contact_type`, `id` and `title`, so these can be referenced without checking isset
Return
array
Method
processSubmissionData public
@inheritDoc
Class

CreateOrder

Create CiviCRM Order from all line items ### Functionality ###

Package
FormProcessing

Method
__construct public

Param
array $actionConfiguration Action configuration array
Param
ContractsCiviObjectsFactory $civiObjectsFactory Factory to provide SDK objects for making API requests
Param
DataModelProvider $dataModelProvider
Param
ExtraDataHandler $extraDataHandler
Method
finalizeActionSettings public
Override the parent's action settings with runtime values
Update the field map drop down values with constructed values from Civi Objects. CiviCrm is not initialized by the time the action settings must be registered, so only get the field values when the actual output is being generated in a form build. The dataModelProvider class handles the structuring of the data.
See
\NinjaForms\CiviCrmShared\Contracts\DataModelProvider
Return
array
Method
processSubmissionData public
@inheritDoc
Method
consolidateLineItems protected
Consolidate all line items from preceding actions
Return
void
Class

EmailProcessor

Method
__construct public
Construct
Param
SdkObject $sdkObject
Param
LoggerInterface $logger
Method
process public
@inheritDoc
Method
extractSubmissionData protected
Extract field mapping data from SubmissionData
Where a key substitute is required (ex:a key structure we don't want to use as a select field lookup key), the lookup values replace our safe value with the API's value.
Return
array
Class

GroupContactProcessor

Method
__construct public
Construct
Param
SdkObject $sdkObject
Param
LoggerInterface $logger
Method
process public
@inheritDoc
Class

ImProcessor

Method
__construct public
Construct
Param
SdkObject $sdkObject
Param
LoggerInterface $logger
Method
process public
@inheritDoc
Method
extractSubmissionData protected
Extract field mapping data from SubmissionData
Where a key substitute is required (ex:a key structure we don't want to use as a select field lookup key), the lookup values replace our safe value with the API's value.
Return
array
Class

LineItemProcessor

Method
__construct public
Construct
Param
SdkObject $sdkObject
Param
LoggerInterface $logger
Method
process public
@inheritDoc
Method
getLineItemsSubmissionData protected
Manually construct each line item from option repeater row This should be refactored into something more scalable; this is meant to test data structures only
Param
string $actionSettingKey
Return
array
Class

ModuleProcessorAbstract

Method
process public
Method
setSubmissionData public
@inheritDoc
Method
setRecordIds public
@inheritDoc
Method
getRecordIds public
@inheritDoc
Method
getResponses public
@inheritDoc
Method
isDupe public
@inheritDoc
Method
setIsDupe public
@inheritDoc
Class

NoteProcessor

Method
__construct public
Construct
Param
SdkObject $sdkObject
Param
LoggerInterface $logger
Method
process public
@inheritDoc
Class

ParticipantProcessor

Method
__construct public
Construct
Param
SdkObject $sdkObject
Param
LoggerInterface $logger
Method
process public
@inheritDoc
Class

PhoneProcessor

Method
__construct public
Construct
Param
SdkObject $sdkObject
Param
LoggerInterface $logger
Method
process public
@inheritDoc
Method
extractSubmissionData protected
Extract field mapping data from SubmissionData
Where a key substitute is required (ex:a key structure we don't want to use as a select field lookup key), the lookup values replace our safe value with the API's value.
Return
array
Class

TagEntityProcessor

Method
__construct public
Construct
Param
SdkObject $sdkObject
Param
LoggerInterface $logger
Method
process public
@inheritDoc
Method
createTag protected
Request SDK object to create tag
Param
array $array
Return
void
Class

WebsiteProcessor

Method
__construct public
Construct
Param
SdkObject $sdkObject
Param
LoggerInterface $logger
Method
process public
@inheritDoc
Method
extractSubmissionData protected
Extract field mapping data from SubmissionData
Where a key substitute is required (ex:a key structure we don't want to use as a select field lookup key), the lookup values replace our safe value with the API's value.
Return
array
Class

ContactsTest

Method
getFieldDefinitionIdLabelPairsEmpty public
Ensure IdLabel pairs are constructed correctly on empty array @test
Method
getFieldDefinitionIdLabelPairsTypical public
Ensure IdLabel pairs are constructed correctly on with values @test
Method
contractsContact protected
Class

$fieldsCollection

Method
__construct public
Method
getFields public
Method
create public
Method
hasMatch public
Does contact have a match
Method
getMatchingId public
Return the matching contact id
Method
getResponse public
Return the CreateObjectResponse
Return
CreateObjectResponse
Class

DataAccessFactoryTest

Method
testConstructsInBypass public
Test that all required methods produce objects while in bypass
Only bypass mode can work in unit tests since there is no CiviCrm plugin to provide the working classes. @test
Class

Method
setUp public
@inheritDoc
Class

ModuleProcessorCollectionTest

Method
testEmptyUsersCollection public
@test
Method
testUsersCollectionWithUserElements public
@test
Class

$collection

Method
getMockModuleProcessor protected
Return mocked ModuleProcessor
Return
ModuleProcessor
Method
process public
Process the form submission data
Return
ModuleProcessor
Method
setSubmissionData public
Set submission Data array
Param
array $submissionData Submission Data array
Return
ModuleProcessor
Method
setRecordIds public
Set array of previously constructed (or matched) Ids
Param
array $recordIds Array of previously constructed (or matched) Ids
Return
ModuleProcessor
Method
getRecordIds public
Get array of previously constructed (or matched) Ids
Return
array
Method
getResponses public
Get collection of CreateObjectResponse objects
Return
CreateObjectResponse[]
Method
isDupe public
Is this processing a previously matched duplicate?
Indicates if the processor will be working on a previously matched duplicate. Important because some processors, like an email, won't run if previously matched on an email.
Return
boolean
Method
setIsDupe public
Sets bool - is this processing a previously matched duplicate
Param
boolean|null $isDupe
Return
ModuleProcessor
Class

MasterTest

Method
ensureServicesRegistered public
Ensure that all required services are register @test
/
Class

PluginTestCase

Method
setUpUnitTestMockEnvironment public
Sets up a mock environment for unit tests Adds just enough function shims to do unit testing in specific areas. Unit tests must not rely upon any of the shimmed functions, which are present only to prevent construction errors from missing function dependencies.
Return
void
Method
defineAbspath protected
Set ABSPATH to the Wordpress directory
Return
void
Method
UnitShims protected
Include WP shims not handled by Brain Monkey
Return
void
Method
shimNinjaForms protected
Shim basic Ninja_Forms() functionality to enable unit testing
Return
void
Method
configureGetOption public
Mock get_option and update_option with global array variable
Param
array $incomingOptions
Return
void
Method
configure public
Return a configuration array
Param
string $configurationName
Param
string $extension
Return
array
Class

GroupContactProcessorTest

Method
ensureObjectToTestConstruct public
@test
Class

Method
ensureMissingEntityTagDataContinuesWithoutErrors public
@test
Method
constructObjectToTest protected
Return mocked ModuleProcessor
Return
void
Method
__construct public
Method
createGroup protected
Class

NoteProcessorTest

Method
ensureObjectToTestConstruct public
@test
Class

Method
ensureMissingEntityTagDataContinuesWithoutErrors public
@test
Method
constructObjectToTest protected
Return mocked ModuleProcessor
Return
void
Method
__construct public
Method
createNote protected
Class

TagEntityProcessorTest

Method
ensureObjectToTestConstruct public
@test
Class

Method
ensureMissingEntityTagDataContinuesWithoutErrors public
@test
Method
constructObjectToTest protected
Return mocked ModuleProcessor
Return
void
Method
__construct public
Method
createTag protected
Class

Method
add_shortcode <?php
Class

Method
esc_html__ <?php
Class

Method
get_option
Method
update_option
Class

Ninja_Forms

This is a shim for Ninja Forms; it does not function, but it provides the named functionality such that unit tests for classes that call Ninja_Forms() on construct can be instantiated without errors. The unit tests calling this instance MUST NOT use any Ninja_Forms() functionality as the results cannot be trusted. Such integration tests will require an environment in which a true Ninja_Forms() class can operate.

Static Method
instance public
Method
form public
Form Model Factory Wrapper
Param
$id
Return
NF_Abstracts_ModelFactory
Method
logger public
Logger Class Wrapper
Example Use: Ninja_Forms()->logger()->log( 'debug', "Hello, {name}!", array( 'name' => 'world' ) ); Ninja_Forms()->logger()->debug( "Hello, {name}!", array( 'name' => 'world' ) );
Return
string
Method
dispatcher public
Method
eos public
Method
session public
Method
request public
Method
background_process public
Method
get_setting public
Get a setting
Param
string $key
Param
bool|false $default
Return
bool
Method
get_settings public
Get all the settings
Return
array
Method
update_setting public
Update a setting
Param
string $key
Param
mixed $value
Param
bool|false $defer_update Defer the database update of all settings
Method
update_settings public
Save settings to database
Param
array $settings
Static Method
template public
Static Method
config public
Method
Ninja_Forms /** * The main function responsible for returning The Highlander Ninja_Forms * Instance to functions everywhere. * * Use this function like you would a global variable, except without needing * to declare the global. * * Example: <?php $nf = Ninja_Forms(); ?> * * @since 2.7 * @return Ninja_Forms Highlander Instance */
Class

Ninja_Forms

Method
plugins_url <?php
Method
is_ssl
Class

Ninja_Forms

Method
__
Class

Ninja_Forms

Method
remove_all_filters /** * Remove all of the hooks from a filter. * * @since 2.7.0 * * @global WP_Hook[] $wp_filter Stores all of the filters and actions. * * @param string $tag The filter to remove hooks from. * @param int|false $priority Optional. The priority number to remove. Default false. * @return true True when finished. */
The plugin API is located in this file, which allows for creating actions and filters and hooking functions, and methods. The functions or methods will then be run when the action or filter is called.
The API callback examples reference functions, but can be methods of classes. To hook methods, you'll need to pass an array one of two ways.
Any of the syntaxes explained in the PHP documentation for the {
Link
https://www.php.net/manual/en/language.pseudo-types.php#language.types.callback 'callback'} type are valid.
Also see the {
Link
https://developer.wordpress.org/plugins/ Plugin API} for more information and examples on how to use a lot of these functions.
This file should have no external dependencies.
Package
WordPress
Subpackage
Plugin
Since
1.5.0
Method
current_action /** * Retrieve the name of the current action. * * @since 3.9.0 * * @return string Hook name of the current action. */
Method
remove_all_actions /** * Remove all of the hooks from an action. * * @since 2.7.0 * * @param string $tag The action to remove hooks from. * @param int|false $priority The priority number to remove them from. Default false. * @return true True when finished. */
Method
plugin_basename /** * Gets the basename of a plugin. * * This method extracts the name of a plugin from its filename. * * @since 1.5.0 * * @global array $wp_plugin_paths * * @param string $file The filename of plugin. * @return string The name of a plugin. */
Method
wp_register_plugin_realpath /** * Register a plugin's real path. * * This is used in plugin_basename() to resolve symlinked paths. * * @since 3.9.0 * * @see wp_normalize_path() * * @global array $wp_plugin_paths * * @param string $file Known path to the file. * @return bool Whether the path was able to be registered. */
Method
plugin_dir_path /** * Get the filesystem directory path (with trailing slash) for the plugin __FILE__ passed in. * * @since 2.8.0 * * @param string $file The filename of the plugin (__FILE__). * @return string the filesystem path of the directory that contains the plugin. */
Method
plugin_dir_url /** * Get the URL directory path (with trailing slash) for the plugin __FILE__ passed in. * * @since 2.8.0 * * @param string $file The filename of the plugin (__FILE__). * @return string the URL path of the directory that contains the plugin. */
Method
register_activation_hook /** * Set the activation hook for a plugin. * * When a plugin is activated, the action 'activate_PLUGINNAME' hook is * called. In the name of this hook, PLUGINNAME is replaced with the name * of the plugin, including the optional subdirectory. For example, when the * plugin is located in wp-content/plugins/sampleplugin/sample.php, then * the name of this hook will become 'activate_sampleplugin/sample.php'. * * When the plugin consists of only one file and is (as by default) located at * wp-content/plugins/sample.php the name of this hook will be * 'activate_sample.php'. * * @since 2.0.0 * * @param string $file The filename of the plugin including the path. * @param callable $function The function hooked to the 'activate_PLUGIN' action. */
Method
register_deactivation_hook /** * Set the deactivation hook for a plugin. * * When a plugin is deactivated, the action 'deactivate_PLUGINNAME' hook is * called. In the name of this hook, PLUGINNAME is replaced with the name * of the plugin, including the optional subdirectory. For example, when the * plugin is located in wp-content/plugins/sampleplugin/sample.php, then * the name of this hook will become 'deactivate_sampleplugin/sample.php'. * * When the plugin consists of only one file and is (as by default) located at * wp-content/plugins/sample.php the name of this hook will be * 'deactivate_sample.php'. * * @since 2.0.0 * * @param string $file The filename of the plugin including the path. * @param callable $function The function hooked to the 'deactivate_PLUGIN' action. */
Method
register_uninstall_hook /** * Set the uninstallation hook for a plugin. * * Registers the uninstall hook that will be called when the user clicks on the * uninstall link that calls for the plugin to uninstall itself. The link won't * be active unless the plugin hooks into the action. * * The plugin should not run arbitrary code outside of functions, when * registering the uninstall hook. In order to run using the hook, the plugin * will have to be included, which means that any code laying outside of a * function will be run during the uninstallation process. The plugin should not * hinder the uninstallation process. * * If the plugin can not be written without running code within the plugin, then * the plugin should create a file named 'uninstall.php' in the base plugin * folder. This file will be called, if it exists, during the uninstallation process * bypassing the uninstall hook. The plugin, when using the 'uninstall.php' * should always check for the 'WP_UNINSTALL_PLUGIN' constant, before * executing. * * @since 2.7.0 * * @param string $file Plugin file. * @param callable $callback The callback to run when the hook is called. Must be * a static method or function. */
Method
_wp_call_all_hook /** * Call the 'all' hook, which will process the functions hooked into it. * * The 'all' hook passes all of the arguments or parameters that were used for * the hook, which this function was called for. * * This function is used internally for apply_filters(), do_action(), and * do_action_ref_array() and is not meant to be used from outside those * functions. This function does not check for the existence of the all hook, so * it will fail unless the all hook exists prior to this function call. * * @since 2.5.0 * @access private * * @global WP_Hook[] $wp_filter Stores all of the filters and actions. * * @param array $args The collected parameters from the hook that was called. */
Method
_wp_filter_build_unique_id /** * Build Unique ID for storage and retrieval. * * The old way to serialize the callback caused issues and this function is the * solution. It works by checking for objects and creating a new property in * the class to keep track of the object and new objects of the same class that * need to be added. * * It also allows for the removal of actions and filters for objects after they * change class properties. It is possible to include the property $wp_filter_id * in your class and set it to "null" or a number to bypass the workaround. * However this will prevent you from adding new classes and any new classes * will overwrite the previous hook by the same class. * * Functions and static method callbacks are just returned as strings and * shouldn't have any speed penalty. * * @link https://core.trac.wordpress.org/ticket/3875 * * @since 2.2.3 * @since 5.3.0 Removed workarounds for spl_object_hash(). * `$tag` and `$priority` are no longer used, * and the function always returns a string. * @access private * * @param string $tag Unused. The name of the filter to build ID for. * @param callable $function The function to generate ID for. * @param int $priority Unused. The order in which the functions * associated with a particular action are executed. * @return string Unique function ID for usage as array key. */
Class

VerifyTestStructureTest

Method
ensureTestSuiteRuns public
@test
Class

CiviFieldDefinitionTest

Method
constructFromExpectedValues public
Ensure valid construction @test
Method
constructFromEmptyValues public
Ensure valid construction from empty array, with isApiError set @test
Class

CiviFieldDefinitionTest

Method
constructFromEmptyArray public
Empty array constructs entity and returns array @test
/
Method
constructFromFullArray public
Full array constructs entity and returns array @test
/
Method
constructFromNullArray public
Null array constructs entity and returns array @test
/
Class

CreateObjectResponseTest

Test CreateObjectResponse - child extensions only Parent class has its own test

Method
constructFromEmptyArray public
Empty array constructs entity and returns array @test
/
Method
constructFromFullArray public
Full array constructs entity and returns array @test
/
Method
constructFromNullArray public
Null array constructs entity and returns array @test
/
Class

GetEventsResponseTest

Method
constructFromEmptyArray public
Empty array constructs entity and returns array @test
/
Method
constructFromFullArray public
Full array constructs entity and returns array @test
/
Method
constructFromNullArray public
Null array constructs entity and returns array @test
/
Class

GetGroupsResponseTest

Method
constructFromEmptyArray public
Empty array constructs entity and returns array @test
/
Method
constructFromFullArray public
Full array constructs entity and returns array @test
/
Method
constructFromNullArray public
Null array constructs entity and returns array @test
/
Class

GetTagsResponseTest

Method
constructFromEmptyArray public
Empty array constructs entity and returns array @test
/
Method
constructFromFullArray public
Full array constructs entity and returns array @test
/
Method
constructFromNullArray public
Null array constructs entity and returns array @test
/
Class

MasterTest

Method
ensureServicesRegistered public
Ensure that all required services are register @test
/
Class

FormActionProcessorTest

Method
ensureObjectToTestConstruction public
Ensure object construction
@test
Return
void
Class

Method
testUndefinedKey public
Ensures that submissions without keys don't throw warnings
@test
Return
void
Method
constructObjectToTest protected
Class

$actionConfiguration

Method
processSubmissionData /** @inheritDoc */
Method
exposeExtractSubmissionData public
Class

HandledResponseTest

Method
constructFromEmptyArray public
Empty array constructs entity and returns array @test
/
Method
constructFromFullyDefinedArray public
Construct from a fully defined array @test
Method
constructFromNullArray public
Null array constructs entity and returns array @test
/
Class

PluginSettingTest

Method
constructFromEmptyArray public
Empty array constructs entity and returns array @test
/
Method
constructFromFullyDefinedArray public
Construct from a fully defined array @test
Class

PluginSettingsTest

Method
constructFromEmptyArray public
Empty array constructs entity and returns array @test
/
Method
constructFromFullyDefinedArray public
Construct from a fully defined array @test
Method
addPluginSetting public
@test
Method
getPluginSettings public
Ensure getPluginSettings returns array of PluginSetting objects keyed on ids @test
Return
void
Method
getPluginSettingsArray public
Ensure getPluginSettingsArray returns array of PluginSetting arrays keyed on ids
@test
Return
void
Class

DataModelsTest

Method
fullyFormedColumnsFromCollected public
columnsFromExpected when data is fully formed @test
/
Method
missingKeysColumnsFromCollected public
columnsFromExpected when collection is missing keys @test
/
Method
emptyCollectionColumnsFromCollected public
columnsFromExpected when collection is empty @test
/
Method
nullCollectionColumnsFromCollected public
columnsFromExpected when collection is null @test
/
Method
fullyFormedKeyValuePairsFromCollection public
keyValuePairsFromCollection when data is fully formed @test
/