Documentation

CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
in package
uses EntityLookupTrait, CRM_Contact_Form_ContactFormTrait, CRM_Event_Form_EventFormTrait, CRM_Custom_Form_CustomDataTrait

Back office participant form.

Table of Contents

Constants

ATTR_SPACING  = '     '
Constants for attributes for various form elements attempt to standardize on the number of variations that we use of the below form elements
CB_PREFIX  = 'mark_x_'
All checkboxes are defined with a common prefix. This allows us to have the same javascript to check / clear all the checkboxes etc If u have multiple groups of checkboxes, you will need to give them different ids to avoid potential name collision
CB_PREFIX_LEN  = 7
All checkboxes are defined with a common prefix. This allows us to have the same javascript to check / clear all the checkboxes etc If u have multiple groups of checkboxes, you will need to give them different ids to avoid potential name collision
CB_PREFIY  = 'mark_y_'
All checkboxes are defined with a common prefix. This allows us to have the same javascript to check / clear all the checkboxes etc If u have multiple groups of checkboxes, you will need to give them different ids to avoid potential name collision
CB_PREFIZ  = 'mark_z_'
All checkboxes are defined with a common prefix. This allows us to have the same javascript to check / clear all the checkboxes etc If u have multiple groups of checkboxes, you will need to give them different ids to avoid potential name collision

Properties

$_action  : int
Page action.
$_bltID  : int
$_compId  : mixed
$_contactID  : int
The id of the contact associated with this contribution
$_contactId  : int
Use parent $this->contactID
$_contactIds  : array<string|int, mixed>
The array that holds all the contact ids
$_contactTypes  : array<string|int, mixed>
The array that holds all the contact types
$_context  : mixed
$_defaults  : array<string|int, mixed>
The default values for the form.
$_discountId  : int
ID of discount record.
$_eID  : int
Event ID preselect.
$_entityIds  : array<string|int, mixed>
The array that holds all the case ids
$_fields  : mixed
$_honorID  : int
Stores the honor id
$_isPaidEvent  : bool
If event is paid or unpaid.
$_lineItems  : array<string|int, mixed>
Store the line items if price set used.
$_mode  : string
Participant mode.
$_noteID  : int
The id of the note
$_online  : bool
Is this contribution associated with an online financial transaction
$_onlinePendingContributionId  : null
$_options  : array<string|int, mixed>
Stores all product option
$_originalDiscountId  : int
Selected discount id.
$_paymentFields  : array<string|int, mixed>
Array of payment related fields to potentially display on this form (generally credit card or debit card fields).
$_paymentProcessor  : array<string|int, mixed>
Current payment processor including a copy of the object in 'object' key.
$_paymentProcessorIDs  : array<string|int, mixed>
Available payment processors (IDS).
$_pId  : int
Participant ID - use getParticipantID.
$_pledgeID  : int
The id of the pledge that we are processing
$_pledgeValues  : array<string|int, mixed>
The pledge values if this contribution is associated with pledge
$_ppID  : int
The id of the pledge payment that we are processing
$_priceSet  : array<string|int, mixed>
Array of fields for the price set.
$_processors  : array<string|int, mixed>
Array of processor options in the format id => array($id => $label) WARNING it appears that the format used to differ to this and there are places in the code that expect the old format. $this->_paymentProcessors provides the additional data which this array seems to have provided in the past
$_recurPaymentProcessors  : array<string|int, mixed>
Available recurring processors.
$_single  : bool
Are we operating in "single mode", i.e. adding / editing only one participant record, or is this a batch add operation.
$_values  : array<string|int, mixed>
The values for the contribution db object.
$ajaxResponse  : array<string|int, mixed>
What to return to the client if in ajax mode (snippet=json)
$controller  : CRM_Core_Controller
$entityShortname  : string
Must be set to entity shortname (eg. event)
$expectedSmartyVariables  : array<string|int, string>
Variables smarty expects to have set.
$html5Types  : array<string|int, mixed>
Extra input types we support via the "add" method
$isBackOffice  : bool
Is this a backoffice form
$paymentInstrumentID  : int
Payment instrument id for the transaction.
$submitOnce  : bool
$tableName  : string
Must be set to entity table name (eg. civicrm_participant) by child class
$urlPath  : array<string|int, mixed>
Url path used to reach this page
$useLivePageJS  : mixed
$_actionButtonName  : string
Name of action button
$_component  : string
Component - event, membership or contribution.
$_componentClause  : string
The additional clause that we restrict the search with
$_componentIds  : array<string|int, mixed>
The array that holds all the component ids
$_componentTable  : string
The name of the temp table where we store the contact IDs
$_eventTypeId  : int
Event Type Id.
$_formType  : mixed
$_name  : string
The name of this form
$_noteId  : int
The id of the note.
$_paymentProcessorID  : int
Default or selected processor id.
$_paymentProcessors  : array<string|int, mixed>
Available payment processors with full details including the key 'object' indexed by their id
$_renderer  : object
The renderer used for this form
$_searchFormValues  : array<string|int, mixed>
This includes the submitted values of the search form
$_state  : object
The state object that this form belongs to
$_statusId  : int
Participant status Id.
$_task  : int
The task being performed
$_template  : CRM_Core_Smarty
Cache the smarty template for efficiency reasons
$_title  : string
The title of this form
$context  : string
Context of the form being loaded.
$contributionID  : int|null
Contribution ID.
$createPaymentParams  : array<string|int, mixed>
Params for creating a payment to add to the contribution.
$entity  : string
Entity that $this->_id relates to.
$exportedValues  : array<string|int, mixed>
Values submitted by the user.
$invoiceID  : string
Invoice ID.
$optionalQuickFormElements  : array<string|int, mixed>
Quick form elements which are conditionally added to the form.
$queryMode  : int
$rows  : array<string|int, mixed>
Rows to act on.
$submittableMoneyFields  : array<string|int, mixed>
Monetary fields that may be submitted.
$unsavedChangesWarn  : bool
Indicate if this form should warn users of unsaved changes
$authenticatedContactID  : int
The contact ID that has been authenticated and can be used for checking permissions.
$entityLookupDefinitions  : array<string|int, mixed>
Array of defined entity identifiers.
$entityLookupValues  : array<string|int, mixed>
Array of defined entity values.
$isValidated  : true
$order  : CRM_Financial_BAO_Order

Methods

__construct()  : CRM_Core_Form
Constructor for the basic form page.
__get()  : mixed
Provide support for extensions that are used to being able to retrieve _lineItem
add()  : HTML_QuickForm_Element
Simple easy to use wrapper around addElement.
addAutocomplete()  : HTML_QuickForm_Element
addAutoSelector()  : mixed
Add autoselector field -if user has permission to view contacts If adding this to a form you also need to add to the tpl e.g
addButtons()  : mixed
Add default Next / Back buttons.
addChainSelect()  : HTML_QuickForm_Element
Create a chain-select target field. All settings are optional; the defaults usually work.
addCheckBox()  : mixed
addCIDZeroOptions()  : mixed
Add the options appropriate to cid = zero - ie. autocomplete
addClass()  : mixed
Add one or more css classes to the form.
addCurrency()  : mixed
Add currency element to the form.
addDate()  : mixed
Add date.
addDatePickerRange()  : mixed
Add a search for a range using date picker fields.
addDateRange()  : mixed
addDateTime()  : mixed
Function that will add date and time.
addDefaultButtons()  : mixed
Simple shell that derived classes can call to add form buttons.
addEntityRef()  : HTML_QuickForm_Element
Create a single or multiple entity ref field.
addExpectedSmartyVariable()  : void
Add an expected smarty variable to the array.
addExpectedSmartyVariables()  : void
Add an expected smarty variable to the array.
addField()  : mixed
Adds a field based on metadata.
addMoney()  : HTML_QuickForm_Element
Add a currency and money element to the form.
addOptionalQuickFormElement()  : void
Add an optional element to the optional elements array.
addProfileSelector()  : mixed
Add a widget for selecting/editing/creating/copying a profile form
addRadio()  : HTML_QuickForm_group
addRules()  : void
Add local and global form rules.
addSelect()  : HTML_QuickForm_Element
Adds a select based on field metadata.
addTaskMenu()  : mixed
Add actions menu to results form.
addUploadElement()  : mixed
addYesNo()  : mixed
allowAjaxSubmit()  : mixed
Sets form attribute.
append()  : mixed
Appends values to template variables.
assign()  : mixed
Assign value to name in template.
assign_by_ref()  : mixed
Assign value to name in template by reference.
assignBillingName()  : string
Assign billing name to the template.
assignBillingType()  : mixed
Assign billing type id to bltID.
assignProcessors()  : mixed
Assign $this->processors, $this->recurPaymentProcessors, and related Smarty variables
assignSalesTaxMetadataToTemplate()  : mixed
Assign information to the template required for sales tax purposes.
assignSalesTaxRates()  : mixed
Assign sales tax rates to the template.
assignSalesTaxTermToTemplate()  : mixed
Assign the sales tax term to the template.
assignVariables()  : mixed
Assign an array of variables to the form/tpl
buildForm()  : mixed
Core function that builds the form.
buildQuickForm()  : void
Build the form object.
buildValuesAndAssignOnline_Note_Type()  : mixed
cancelAction()  : mixed
Function that can be defined in Form to override or.
canUseAjaxContactLookups()  : bool
createHiddenGroup()  : array<string|int, mixed>
Given this task's list of targets, produce a hidden group.
error()  : mixed
Error reporting mechanism.
formatCreditCardDetails()  : array<string|int, mixed>
Format credit card details like: 1. Retrieve last 4 digit from credit card number as pan_truncation 2. Retrieve credit card type id from name
formRule()  : array<string|int, mixed>|true
Global validation rules for the form.
get()  : mixed
Get the variable from the form scope.
get_template_vars()  : array<string|int, mixed>
Returns an array containing template variables.
getAction()  : int|null
Getter for action.
getAuthenticatedContactID()  : int
Get the authenticated contact ID.
getCompleteTitle()  : string
getContactID()  : int|null
Get the contact ID in use.
getContactIDsFromComponent()  : array<string|int, mixed>
Given the component id, compute the contact id since it's used for things like send email.
getContactValue()  : mixed
Get a value for the contact being acted on in the form.
getContext()  : string
getContributionID()  : int|null
Get the contribution ID.
getCurrency()  : string
Get the currency for the event.
getDefaultContext()  : string
Default form context used as part of addField()
getDefaultEntity()  : string
Explicitly declare the entity api name.
getDiscountID()  : int|null
Get the discount ID.
getDistinctComponentClause()  : string
Get the clause for grouping by the component.
getEntityAliasField()  : string
Get the group by clause for the component.
getEventID()  : int|null
Get the selected Event ID.
getEventValue()  : mixed
Get the value for a field relating to the event.
getFeeDetails()  : array<string|int, mixed>
Get the event fee info for given participant ids either from line item table / participant table.
getFormContext()  : string
Get the form context.
getGroupByComponentClause()  : string
Get the group by clause for the component.
getHookedTemplateFileName()  : mixed
A wrapper for getTemplateFileName.
getInvoiceID()  : string
Get the unique invoice ID.
getLineItems()  : array<string|int, mixed>
Get the selected line items.
getLoggedInUserContactID()  : int|false
Get the contact id of the logged in user.
getName()  : string
Getter function for Name.
getOptionalQuickFormElements()  : array<string|int, mixed>
Get any quick-form elements that may not be present in the form.
getParticipantID()  : int|null
Get id of participant being edited.
getParticipantValue()  : mixed
Get a value from the participant being acted on.
getPaymentProcessorID()  : int|null
getPriceFieldMetaData()  : array<string|int, mixed>
Get price field metadata.
getPriceSetID()  : int|null
Get the Price Set ID in use.
getProfileDefaults()  : array<string|int, mixed>
Set default values on form for given contact (or no contact defaults)
getQueryMode()  : int
Get the query mode (eg. CRM_Core_BAO_Query::MODE_CASE) Should be overridden by child classes in most cases
getRenderer()  : CRM_Core_Form_Renderer
Getter function for renderer.
getRequestedContactID()  : int|null
Get the contact ID that has been requested (via url or form value).
getRootTitle()  : null
getSalesTaxTerm()  : string
Return the string to be assigned to the template for sales tax - e.g GST, VAT.
getSearchFormValues()  : array<string|int, mixed>
Get the submitted values for the form.
getSelectedIDs()  : array<string|int, mixed>
Get the ids the user has selected or an empty array if selection has not been used.
getState()  : object
Getter function for State.
getStateType()  : int
Getter function for StateType.
getSubmittedValue()  : mixed|null
Get value submitted by the user.
getSubmittedValues()  : array<string|int, mixed>
Get values submitted by the user.
getTableName()  : string
Get the name of the table for the relevant entity.
getTaxRateForFinancialType()  : string
getTaxRatesForFinancialTypes()  : array<string|int, mixed>
Get sales tax rates.
getTemplate()  : CRM_Core_Smarty
getTemplateFileName()  : string
Use the form name to create the tpl file name.
getTemplateVars()  : mixed
Get the value/s assigned to the Template Engine (Smarty).
getTitle()  : string
Getter function for title.
getUFGroupIDs()  : array<string|int, mixed>
Get the active UFGroups (profiles) on this form Many forms load one or more UFGroups (profiles).
getValidProcessors()  : array<string|int, mixed>
getVar()  : mixed
isDefined()  : bool
Check if an entity can be looked up
isEventFull()  : bool
Is the event full already.
isFormInEditMode()  : bool
Is the form in edit mode.
isFormInViewMode()  : bool
Is the form in view mode.
isQuickConfig()  : bool
Is the price set quick config.
isTest()  : bool
Is the form being submitted in test mode.
listTokens()  : array<string|int, mixed>
List available tokens for this form.
lookup()  : mixed
Retrieve a field value for a defined entity
mainProcess()  : mixed
Main process wrapper.
mergeContactIdsByHousehold()  : mixed
Replace ids of household members in $this->_contactIds with the id of their household.
orderBy()  : string
Default ordering for getContactIDsFromComponent. Subclasses can override.
overrideExtraTemplateFileName()  : string
Default extra tpl file basically just replaces .tpl with .extra.tpl.
postProcess()  : mixed
Process the form submission.
postProcessHook()  : mixed
The postProcess hook is typically called by the framework.
preProcess()  : mixed
Set variables up before form is built.
preProcessCommon()  : mixed
Common pre-processing function.
preventAjaxSubmit()  : mixed
Sets form attribute.
registerFileField()  : void
Register a field with quick form as supporting a file upload.
registerRules()  : mixed
Register all the standard rules that most forms potentially use.
removeFileRequiredRules()  : mixed
resetValues()  : mixed
set()  : mixed
Store the variable with the value in the form scope.
setAction()  : mixed
Setter for action.
setContactIDs()  : mixed
Given the entity id, compute the contact id since its used for things like send email For example, for cases we need to override this function as the table name is civicrm_case_contact
setContext()  : mixed
Set context variable.
setDefaultValues()  : array<string|int, mixed>
This function sets the default values for the form in edit/view mode the default values are retrieved from the database
setNextUrl()  : mixed
Set where the browser should be directed to next.
setOptions()  : mixed
Setter function for options.
setPageTitle()  : void
Sets page title based on entity and action.
setPurifiedDefaults()  : mixed
setSelectedChild()  : mixed
Set the active tab
setTitle()  : mixed
Setter function for title.
setVar()  : mixed
showRecordLinkMesssage()  : mixed
toSmarty()  : string
Render form and return contents.
unsetCreditCardFields()  : mixed
validate()  : bool
Performs the server side validation.
validateMandatoryFields()  : mixed
Helper function to verify that required fields have been filled.
addParticipant()  : CRM_Event_BAO_Participant
Process the participant.
addPaymentProcessorSelect()  : mixed
Add the payment processor select to the form.
assignContactEmailDetails()  : void
assignContactID()  : void
assignEventDetailsToTpl()  : void
assignPaymentInfoBlock()  : mixed
Assign the values to build the payment info block.
assignPaymentProcessor()  : mixed
This if a front end form function for setting the payment processor.
assignPaymentRelatedVariables()  : mixed
Common block for setting up the parts of a form that relate to credit / debit card
assignUrlPath()  : mixed
Assign the url path to the template.
beginPostProcess()  : mixed
Begin post processing.
define()  : void
Defines a record so its values can be retrieved using `$this->lookup()`
formatParamsForPaymentProcessor()  : array<string|int, mixed>
Format the fields in $this->_params for the payment processor.
getApiAction()  : mixed
Based on form action, return a string representing the api action.
getAuthenticatedCheckSumContactID()  : int
Get the contact ID authenticated as a valid by checksum.
getAvailableFromEmails()  : array<string|int, mixed>
Get the emails available for the from address.
getBillingDefaults()  : array<string|int, mixed>
Get default values for billing fields.
getContactIDIfAccessingOwnRecord()  : int|false
Get the contact if from the url, using the checksum or the cid if it is the logged in user.
getContactIDs()  : array<string|int, mixed>
Get the relevant contact IDs.
getCreatePaymentParams()  : array<string|int, mixed>
Get params to create payments.
getDefaultPaymentInstrumentId()  : int
Get the default payment instrument id.
getDefinition()  : array{entityName: string, identifier: array}|null
Retrieve entity definition (entityName string, identifier [keys/values])
getExistingContributionID()  : null|int
getFieldsToExcludeFromPurification()  : array<string|int, mixed>
Override this in a subclass to prevent fields intended to contain "raw html" from getting broken. E.g. system message templates
getOrder()  : CRM_Financial_BAO_Order|null
Get the order object, if the event is paid.
getRevenueRecognitionDate()  : string
Get the value for the revenue recognition date field.
getRows()  : array<string|int, mixed>
Get the rows from the results.
getStatusMsg()  : string
Get status message
getSubmittableFields()  : array<string|int, string>
Get the fields that can be submitted in this form flow.
getTokenSchema()  : array<string|int, mixed>
Get the token processor schema required to list any tokens for this task.
handlePreApproval()  : mixed
Handle pre approval for processors.
initializeOrder()  : void
Instantiate the order object.
isFormInViewOrEditMode()  : bool
Is the form in view or edit mode.
isOverloadFeesMode()  : bool
Is the form being accessed in overload fees mode.
isPaymentOnExistingContribution()  : bool
Is a payment being made on an existing contribution.
legacyGetContactIds()  : array<string|int, mixed>
Get the contact ids for: - "Select Records: All xx records" - custom search (FIXME: does this still apply to custom search?).
preparePaidEventProcessing()  : array<string|int, mixed>
Extracted code relating to paid events.
prepareParamsForPaymentProcessor()  : array<string|int, mixed>
Format the fields in $params for the payment processor.
preProcessPaymentOptions()  : mixed
Handle Payment Processor switching for contribution and event registration forms.
processBillingAddress()  : void
Add the billing address to the contact who paid.
processContribution()  : CRM_Contribute_BAO_Contribution
Process the contribution.
pushUrlToUserContext()  : void
Push path to the userContext (defaults to current url path).
sendReceipts()  : array<string|int, mixed>
setContactID()  : null|int
Get contact iD for a form object.
setCreatePaymentParams()  : void
Set params to create payments.
setTranslatedFields()  : mixed
Set translated fields.
storePaymentCreateParams()  : void
Store the parameters to create a payment, if appropriate, on the form.
validateAuthenticatedCheckSumContactID()  : int
Verify that a contact ID is authenticated as a valid contact by checksum
formatReferenceFieldAttributes()  : mixed
getExtendsEntityColumnID()  : int|null
Get the relevant mapping for civicrm_custom_group.extends_entity_column_value.
getSelectedContactNames()  : array<string|int, mixed>
getSourceText()  : string
Get the text for the participant & contribution source fields.
preProcessChainSelectFields()  : mixed
Set options and attributes for chain select fields based on the controlling field's value
selectOrAnyPlaceholder()  : string
Handles a repeated bit supplying a placeholder for entity selection
validateChainSelectFields()  : mixed
Validate country / state / county match and suppress unwanted "required" errors

Constants

ATTR_SPACING

Constants for attributes for various form elements attempt to standardize on the number of variations that we use of the below form elements

public string ATTR_SPACING = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'

CB_PREFIX

All checkboxes are defined with a common prefix. This allows us to have the same javascript to check / clear all the checkboxes etc If u have multiple groups of checkboxes, you will need to give them different ids to avoid potential name collision

public string|int CB_PREFIX = 'mark_x_'

CB_PREFIX_LEN

All checkboxes are defined with a common prefix. This allows us to have the same javascript to check / clear all the checkboxes etc If u have multiple groups of checkboxes, you will need to give them different ids to avoid potential name collision

public string|int CB_PREFIX_LEN = 7

CB_PREFIY

All checkboxes are defined with a common prefix. This allows us to have the same javascript to check / clear all the checkboxes etc If u have multiple groups of checkboxes, you will need to give them different ids to avoid potential name collision

public string|int CB_PREFIY = 'mark_y_'

CB_PREFIZ

All checkboxes are defined with a common prefix. This allows us to have the same javascript to check / clear all the checkboxes etc If u have multiple groups of checkboxes, you will need to give them different ids to avoid potential name collision

public string|int CB_PREFIZ = 'mark_z_'

Properties

$_contactID

The id of the contact associated with this contribution

public int $_contactID

$_contactId

Use parent $this->contactID

public int $_contactId

The id of the contact associated with this participation.

$_contactIds

The array that holds all the contact ids

public array<string|int, mixed> $_contactIds

$_contactTypes

The array that holds all the contact types

public array<string|int, mixed> $_contactTypes

$_defaults

The default values for the form.

public array<string|int, mixed> $_defaults = []

$_discountId

ID of discount record.

public int $_discountId

$_entityIds

The array that holds all the case ids

public array<string|int, mixed> $_entityIds

$_isPaidEvent

If event is paid or unpaid.

public bool $_isPaidEvent

$_lineItems

Store the line items if price set used.

public array<string|int, mixed> $_lineItems

$_online

Is this contribution associated with an online financial transaction

public bool $_online

$_onlinePendingContributionId

public null $_onlinePendingContributionId
Tags
todo

add explanatory note about this

$_originalDiscountId

Selected discount id.

public int $_originalDiscountId

$_paymentFields

Array of payment related fields to potentially display on this form (generally credit card or debit card fields).

public array<string|int, mixed> $_paymentFields = []

Note that this is not accessed in core except in a function that could use a local variable but both IATS & TSys access it.

This is rendered via billingBlock.tpl.

$_paymentProcessor

Current payment processor including a copy of the object in 'object' key.

public array<string|int, mixed> $_paymentProcessor

$_paymentProcessorIDs

Available payment processors (IDS).

public array<string|int, mixed> $_paymentProcessorIDs

As part of trying to consolidate various payment pages we store processors here & have functions at this level to manage them. An alternative would be to have a separate Form that is inherited by all forms that allow payment processing.

An array of the IDS available on this form.

$_pId

Participant ID - use getParticipantID.

unused

public int $_pId

$_pledgeValues

The pledge values if this contribution is associated with pledge

public array<string|int, mixed> $_pledgeValues

$_priceSet

Array of fields for the price set.

public array<string|int, mixed> $_priceSet

$_processors

Array of processor options in the format id => array($id => $label) WARNING it appears that the format used to differ to this and there are places in the code that expect the old format. $this->_paymentProcessors provides the additional data which this array seems to have provided in the past

public array<string|int, mixed> $_processors

$_recurPaymentProcessors

Available recurring processors.

public array<string|int, mixed> $_recurPaymentProcessors = []

$_single

Are we operating in "single mode", i.e. adding / editing only one participant record, or is this a batch add operation.

public bool $_single = \TRUE

Note the goal is to disentangle all the non-single stuff to CRM_Event_Form_Task_Register and discontinue this param.

$_values

The values for the contribution db object.

use $this->getPriceFieldMetadata()

public array<string|int, mixed> $_values

$ajaxResponse

What to return to the client if in ajax mode (snippet=json)

public array<string|int, mixed> $ajaxResponse = []

$entityShortname

Must be set to entity shortname (eg. event)

public static string $entityShortname = \NULL

$expectedSmartyVariables

Variables smarty expects to have set.

public array<string|int, string> $expectedSmartyVariables = [ // in CMSPrint.tpl 'breadcrumb', 'pageTitle', 'urlIsPublic', 'isDeleted', // in 'body.tpl 'suppressForm', 'beginHookFormElements', // required for footer.tpl 'contactId', // required for info.tpl 'infoMessage', 'infoTitle', 'infoType', 'infoOptions', // required for attachmentjs.tpl 'context', // FormButtons.tpl (adds buttons to forms). 'linkButtons', // Required for contactFooter.tpl. // See CRM_Activity_Form_ActivityTest:testInboundEmailDisplaysWithLineBreaks. 'external_identifier', 'lastModified', 'created_date', 'changeLog', // Required for footer.tpl, // See CRM_Activity_Form_ActivityTest:testInboundEmailDisplaysWithLineBreaks. 'footer_status_severity', // Required for some profiles (e.g on the Main page of the contribution form flow). // A bit tricky to add closer to the usage due to conditionality of inclusion 'showCMS', ]

We ensure these are assigned (value = NULL) when Smarty is instantiated in order to avoid e-notices / having to use empty or isset in the template layer.

$html5Types

Extra input types we support via the "add" method

public static array<string|int, mixed> $html5Types = ['number', 'url', 'email', 'color']

$paymentInstrumentID

Payment instrument id for the transaction.

public int $paymentInstrumentID

$submitOnce

public bool $submitOnce = \FALSE

$tableName

Must be set to entity table name (eg. civicrm_participant) by child class

public static string $tableName = \NULL

$urlPath

Url path used to reach this page

public array<string|int, mixed> $urlPath = []

$_actionButtonName

Name of action button

protected string $_actionButtonName

$_component

Component - event, membership or contribution.

protected string $_component

$_componentClause

The additional clause that we restrict the search with

protected string $_componentClause = \NULL

$_componentIds

The array that holds all the component ids

protected array<string|int, mixed> $_componentIds

$_componentTable

The name of the temp table where we store the contact IDs

protected string $_componentTable = \NULL

$_eventTypeId

Event Type Id.

protected int $_eventTypeId = \NULL

$_name

The name of this form

protected string $_name

$_noteId

The id of the note.

protected int $_noteId = \NULL

$_paymentProcessorID

Default or selected processor id.

protected int $_paymentProcessorID

As part of trying to consolidate various payment pages we store processors here & have functions at this level to manage them. An alternative would be to have a separate Form that is inherited by all forms that allow payment processing.

$_paymentProcessors

Available payment processors with full details including the key 'object' indexed by their id

protected array<string|int, mixed> $_paymentProcessors = []

$_renderer

The renderer used for this form

protected object $_renderer

$_searchFormValues

This includes the submitted values of the search form

protected static array<string|int, mixed> $_searchFormValues

$_state

The state object that this form belongs to

protected object $_state

$_statusId

Participant status Id.

protected int $_statusId = \NULL

$_task

The task being performed

protected int $_task

$_template

Cache the smarty template for efficiency reasons

protected static CRM_Core_Smarty $_template

$_title

The title of this form

protected string $_title = \NULL

$context

Context of the form being loaded.

protected string $context

'event' or null

$createPaymentParams

Params for creating a payment to add to the contribution.

protected array<string|int, mixed> $createPaymentParams = []

$entity

Entity that $this->_id relates to.

protected string $entity

If set the contact id is not required in the url.

$exportedValues

Values submitted by the user.

protected array<string|int, mixed> $exportedValues = []

These values have been checked for injection per https://pear.php.net/manual/en/package.html.html-quickform.html-quickform.exportvalues.php and are as submitted.

Once set this array should be treated as read only.

$invoiceID

Invoice ID.

protected string $invoiceID

This is a generated unique string.

$optionalQuickFormElements

Quick form elements which are conditionally added to the form.

protected array<string|int, mixed> $optionalQuickFormElements = []

Elements in this array will be added to the form at the end if not present so that smarty does not e-notice on things like '{if $form.group}' when 'group' is not added to the form (e.g when no groups exist).

$queryMode

protected int $queryMode

$rows

Rows to act on.

protected array<string|int, mixed> $rows = []

e.g [ ['contact_id' => 4, 'participant_id' => 6, 'schema' => ['contactId' => 5, 'participantId' => 6], ]

$submittableMoneyFields

Monetary fields that may be submitted.

protected array<string|int, mixed> $submittableMoneyFields = ['total_amount', 'net_amount', 'non_deductible_amount', 'fee_amount']

These should get a standardised format in the beginPostProcess function.

These fields are common to many forms. Some may override this.

$unsavedChangesWarn

Indicate if this form should warn users of unsaved changes

protected bool $unsavedChangesWarn

$authenticatedContactID

The contact ID that has been authenticated and can be used for checking permissions.

private int $authenticatedContactID

It could be a combination of cid in the url plus a checksum or the logged in user. Importantly it can be used to run permission checks on.

$entityLookupDefinitions

Array of defined entity identifiers.

private array<string|int, mixed> $entityLookupDefinitions = []

$entityLookupValues

Array of defined entity values.

private array<string|int, mixed> $entityLookupValues = []

$isValidated

private true $isValidated = \FALSE

Methods

__construct()

Constructor for the basic form page.

public __construct([object $state = NULL ][, int $action = CRM_Core_Action::NONE ][, string $method = 'post' ][, string $name = NULL ]) : CRM_Core_Form

We should not use QuickForm directly. This class provides a lot of default convenient functions, rules and buttons

Parameters
$state : object = NULL

State associated with this form.

$action : int = CRM_Core_Action::NONE

The mode the form is operating in (None/Create/View/Update/Delete)

$method : string = 'post'

The type of http method used (GET/POST).

$name : string = NULL

The name of the form if different from class name.

Return values
CRM_Core_Form

__get()

Provide support for extensions that are used to being able to retrieve _lineItem

public __get(string $name) : mixed

Note extension should call getPriceSetID() and getLineItems() directly. They are supported for external use per the api annotation.

Parameters
$name : string
Tags
noinspection

PhpUnhandledExceptionInspection

add()

Simple easy to use wrapper around addElement.

public & add(string $type, string $name[, string $label = '' ][, array<string|int, mixed> $attributes = NULL ][, bool $required = FALSE ][, array<string|int, mixed> $extra = NULL ]) : HTML_QuickForm_Element

Deal with simple validation rules.

Parameters
$type : string
$name : string
$label : string = ''
$attributes : array<string|int, mixed> = NULL

(options for select elements)

$required : bool = FALSE
$extra : array<string|int, mixed> = NULL

(attributes for select elements). For datepicker elements this is consistent with the data from CRM_Utils_Date::getDatePickerExtra

Tags
noinspection

PhpDocMissingThrowsInspection

noinspection

PhpUnhandledExceptionInspection

Return values
HTML_QuickForm_Element

Could be an error object

addAutocomplete()

public addAutocomplete(string $name[, string $label = '' ][, array<string|int, mixed> $props = [] ][, bool $required = FALSE ]) : HTML_QuickForm_Element
Parameters
$name : string
$label : string = ''
$props : array<string|int, mixed> = []
$required : bool = FALSE
Return values
HTML_QuickForm_Element

addAutoSelector()

Add autoselector field -if user has permission to view contacts If adding this to a form you also need to add to the tpl e.g

public addAutoSelector([array<string|int, mixed> $profiles = [] ][, array<string|int, mixed> $autoCompleteField = [] ]) : mixed

{if !empty($selectable)}

{$form.select_contact.label}
{$form.select_contact.html}
{/if}
Parameters
$profiles : array<string|int, mixed> = []

Ids of profiles that are on the form (to be autofilled).

$autoCompleteField : array<string|int, mixed> = []
  • name_field
  • id_field
  • url (for ajax lookup)
Tags
throws
CRM_Core_Exception
todo

add data attributes so we can deal with multiple instances on a form

addButtons()

Add default Next / Back buttons.

public addButtons(array<string|int, mixed> $params) : mixed
Parameters
$params : array<string|int, mixed>

Array of associative arrays in the order in which the buttons should be displayed. The associate array has 3 fields: 'type', 'name' and 'isDefault' The base form class will define a bunch of static arrays for commonly used formats.

addChainSelect()

Create a chain-select target field. All settings are optional; the defaults usually work.

public addChainSelect(string $elementName[, array<string|int, mixed> $settings = [] ]) : HTML_QuickForm_Element
Parameters
$elementName : string
$settings : array<string|int, mixed> = []
Return values
HTML_QuickForm_Element

addCheckBox()

public addCheckBox(int $id, string $title, array<string|int, mixed> $values[, null $other = NULL ][, null $attributes = NULL ][, null $required = NULL ][, null $javascriptMethod = NULL ][, string $separator = '<br />' ][, bool $flipValues = FALSE ]) : mixed
Parameters
$id : int
$title : string
$values : array<string|int, mixed>
$other : null = NULL
$attributes : null = NULL
$required : null = NULL
$javascriptMethod : null = NULL
$separator : string = '<br />'
$flipValues : bool = FALSE

addCIDZeroOptions()

Add the options appropriate to cid = zero - ie. autocomplete

public addCIDZeroOptions() : mixed
Tags
todo

there is considerable code duplication between the contribution forms & event forms. It is apparent that small pieces of duplication are not being refactored into separate functions because their only shared parent is this form. Inserting a class FrontEndForm.php between the contribution & event & this class would allow functions like this and a dozen other small ones to be refactored into a shared parent with the reduction of much code duplication

addClass()

Add one or more css classes to the form.

public addClass(string $className) : mixed
Parameters
$className : string

addCurrency()

Add currency element to the form.

public addCurrency([string $name = 'currency' ][, string $label = NULL ][, bool $required = TRUE ][, string $defaultCurrency = NULL ][, bool $freezeCurrency = FALSE ][, bool $setDefaultCurrency = TRUE ]) : mixed
Parameters
$name : string = 'currency'
$label : string = NULL
$required : bool = TRUE
$defaultCurrency : string = NULL
$freezeCurrency : bool = FALSE
$setDefaultCurrency : bool = TRUE

addDate()

Add date.

public addDate(string $name, string $label[, bool $required = FALSE ][, array<string|int, mixed> $attributes = NULL ]) : mixed

Use $this->add('datepicker', ...) instead.

Parameters
$name : string

Name of the element.

$label : string

Label of the element.

$required : bool = FALSE

True if required.

$attributes : array<string|int, mixed> = NULL

Key / value pair.

addDatePickerRange()

Add a search for a range using date picker fields.

public addDatePickerRange(string $fieldName, string $label[, bool $isDateTime = FALSE ][, bool $required = FALSE ][, string $fromLabel = 'From' ][, string $toLabel = 'To' ][, array<string|int, mixed> $additionalOptions = [] ][, string $to = '_high' ][, string $from = '_low' ]) : mixed
Parameters
$fieldName : string
$label : string
$isDateTime : bool = FALSE

Is this a date-time field (not just date).

$required : bool = FALSE
$fromLabel : string = 'From'
$toLabel : string = 'To'
$additionalOptions : array<string|int, mixed> = []
$to : string = '_high'

string to append to the to field.

$from : string = '_low'

string to append to the from field.

addDateRange()

public addDateRange(string $name[, string $from = '_from' ][, string $to = '_to' ][, string $label = 'From:' ][, string $dateFormat = 'searchDate' ][, bool $required = FALSE ][, bool $displayTime = FALSE ]) : mixed

Use $this->addDatePickerRange() instead.

Parameters
$name : string
$from : string = '_from'
$to : string = '_to'
$label : string = 'From:'
$dateFormat : string = 'searchDate'
$required : bool = FALSE
$displayTime : bool = FALSE

addDateTime()

Function that will add date and time.

public addDateTime(string $name, string $label[, bool $required = FALSE ][, array<string|int, mixed> $attributes = NULL ]) : mixed

Use $this->add('datepicker', ...) instead.

Parameters
$name : string
$label : string
$required : bool = FALSE
$attributes : array<string|int, mixed> = NULL

addDefaultButtons()

Simple shell that derived classes can call to add form buttons.

public addDefaultButtons(string $title[, string $nextType = 'next' ][, string $backType = 'back' ][, bool $submitOnce = FALSE ]) : mixed

Allows customized title for the main Submit

Parameters
$title : string

Title of the main button.

$nextType : string = 'next'

Button type for the form after processing.

$backType : string = 'back'
$submitOnce : bool = FALSE

addEntityRef()

Create a single or multiple entity ref field.

public addEntityRef(string $name[, string $label = '' ][, array<string|int, mixed> $props = [] ][, bool $required = FALSE ]) : HTML_QuickForm_Element
Parameters
$name : string
$label : string = ''
$props : array<string|int, mixed> = []

Mix of html and widget properties, including:.

  • select - params to give to select2 widget
  • entity - defaults to Contact
  • create - can the user create a new entity on-the-fly? Set to TRUE if entity is contact and you want the default profiles, or pass in your own set of links. @see CRM_Campaign_BAO_Campaign::getEntityRefCreateLinks for format note that permissions are checked automatically
  • api - array of settings for the getlist api wrapper note that it accepts a 'params' setting which will be passed to the underlying api
  • placeholder - string
  • multiple - bool
  • class, etc. - other html properties
$required : bool = FALSE
Return values
HTML_QuickForm_Element

addExpectedSmartyVariable()

Add an expected smarty variable to the array.

public addExpectedSmartyVariable(string $elementName) : void
Parameters
$elementName : string

addExpectedSmartyVariables()

Add an expected smarty variable to the array.

public addExpectedSmartyVariables(array<string|int, mixed> $elementNames) : void
Parameters
$elementNames : array<string|int, mixed>

addField()

Adds a field based on metadata.

public addField(mixed $name[, array<string|int, mixed> $props = [] ][, bool $required = FALSE ][, bool $legacyDate = TRUE ]) : mixed
Parameters
$name : mixed

Field name to go on the form.

$props : array<string|int, mixed> = []

Mix of html attributes and special properties, namely.

  • entity (api entity name, can usually be inferred automatically from the form class)
  • name (field name - only needed if different from name used on the form)
  • option_url - path to edit this option list - usually retrieved automatically - set to NULL to disable link
  • placeholder - set to NULL to disable
  • multiple - bool
  • context - @see CRM_Core_DAO::buildOptionsContext
$required : bool = FALSE
$legacyDate : bool = TRUE

Temporary param to facilitate the conversion of fields to use the datepicker in a controlled way. To convert the field the jcalendar code needs to be removed from the tpl as well. That file is intended to be EOL.

Tags
throws
CRM_Core_Exception
throws
Exception
Return values
mixed

HTML_QuickForm_element void

addMoney()

Add a currency and money element to the form.

public addMoney(string $name, string $label[, bool $required = FALSE ][, array<string|int, mixed> $attributes = NULL ][, bool $addCurrency = TRUE ][, string $currencyName = 'currency' ][, string $defaultCurrency = NULL ][, bool $freezeCurrency = FALSE ]) : HTML_QuickForm_Element
Parameters
$name : string
$label : string
$required : bool = FALSE
$attributes : array<string|int, mixed> = NULL
$addCurrency : bool = TRUE
$currencyName : string = 'currency'
$defaultCurrency : string = NULL
$freezeCurrency : bool = FALSE
Return values
HTML_QuickForm_Element

addOptionalQuickFormElement()

Add an optional element to the optional elements array.

public addOptionalQuickFormElement(string $elementName) : void

These elements are assigned as empty (null) variables if there is no real field - allowing smarty to use them without notices.

Parameters
$elementName : string

addProfileSelector()

Add a widget for selecting/editing/creating/copying a profile form

public addProfileSelector(string $name, string $label, string $allowCoreTypes, string $allowSubTypes, array<string|int, mixed> $entities[, bool $default = FALSE ][, string $usedFor = NULL ]) : mixed
Parameters
$name : string

HTML form-element name.

$label : string

Printable label.

$allowCoreTypes : string

Only present a UFGroup if its group_type includes a subset of $allowCoreTypes; e.g. 'Individual', 'Activity'.

$allowSubTypes : string

Only present a UFGroup if its group_type is compatible with $allowSubypes.

$entities : array<string|int, mixed>
$default : bool = FALSE

//CRM-15427.

$usedFor : string = NULL

addRadio()

public & addRadio(string $name, string $title, array<string|int, mixed> $values[, array<string|int, mixed> $attributes = [] ][, string $separator = NULL ][, bool $required = FALSE ][, array<string|int, mixed> $optionAttributes = [] ]) : HTML_QuickForm_group
Parameters
$name : string
$title : string
$values : array<string|int, mixed>
$attributes : array<string|int, mixed> = []
$separator : string = NULL
$required : bool = FALSE
$optionAttributes : array<string|int, mixed> = []
  • Option specific attributes
Return values
HTML_QuickForm_group

addRules()

Add local and global form rules.

public addRules() : void

addSelect()

Adds a select based on field metadata.

public addSelect(string $name[, array<string|int, mixed> $props = [] ][, bool $required = FALSE ]) : HTML_QuickForm_Element

TODO: This could be even more generic and widget type (select in this case) could also be read from metadata Perhaps a method like $form->bind($name) which would look up all metadata for named field

Parameters
$name : string

Field name to go on the form.

$props : array<string|int, mixed> = []

Mix of html attributes and special properties, namely.

  • entity (api entity name, can usually be inferred automatically from the form class)
  • field (field name - only needed if different from name used on the form)
  • option_url - path to edit this option list - usually retrieved automatically - set to NULL to disable link
  • placeholder - set to NULL to disable
  • multiple - bool
  • context - @see CRM_Core_DAO::buildOptionsContext
$required : bool = FALSE
Tags
throws
CRM_Core_Exception
Return values
HTML_QuickForm_Element

addTaskMenu()

Add actions menu to results form.

public addTaskMenu(array<string|int, mixed> $tasks) : mixed
Parameters
$tasks : array<string|int, mixed>

addUploadElement()

public addUploadElement(array<string|int, string>|string $elementName) : mixed
Parameters
$elementName : array<string|int, string>|string

addYesNo()

public addYesNo(string $id, string $title[, bool $allowClear = FALSE ][, bool $required = NULL ][, array<string|int, mixed> $attributes = [] ]) : mixed
Parameters
$id : string
$title : string
$allowClear : bool = FALSE
$required : bool = NULL
$attributes : array<string|int, mixed> = []

allowAjaxSubmit()

Sets form attribute.

public allowAjaxSubmit() : mixed
Tags
see

CRM.loadForm

append()

Appends values to template variables.

public append(array<string|int, mixed>|string $tpl_var[, mixed $value = NULL ][, bool $merge = FALSE ]) : mixed
Parameters
$tpl_var : array<string|int, mixed>|string

the template variable name(s)

$value : mixed = NULL

The value to append.

$merge : bool = FALSE

assign()

Assign value to name in template.

public assign(string $var[, mixed $value = NULL ]) : mixed
Parameters
$var : string

Name of variable.

$value : mixed = NULL

Value of variable.

assign_by_ref()

Assign value to name in template by reference.

public assign_by_ref(string $var, mixed &$value) : mixed

since 5.72 will be removed around 5.84

Parameters
$var : string

Name of variable.

$value : mixed

Value of variable.

assignBillingName()

Assign billing name to the template.

public assignBillingName([array<string|int, mixed> $params = [] ]) : string
Parameters
$params : array<string|int, mixed> = []

Form input params, default to $this->_params.

Return values
string

assignBillingType()

Assign billing type id to bltID.

public assignBillingType() : mixed
Tags
throws
CRM_Core_Exception

assignProcessors()

Assign $this->processors, $this->recurPaymentProcessors, and related Smarty variables

public assignProcessors() : mixed

assignSalesTaxMetadataToTemplate()

Assign information to the template required for sales tax purposes.

public assignSalesTaxMetadataToTemplate() : mixed

assignSalesTaxRates()

Assign sales tax rates to the template.

public assignSalesTaxRates() : mixed

assignSalesTaxTermToTemplate()

Assign the sales tax term to the template.

public assignSalesTaxTermToTemplate() : mixed

since 5.69 will be removed around 5.80

assignVariables()

Assign an array of variables to the form/tpl

public assignVariables(array<string|int, mixed> $values, array<string|int, mixed> $keys) : mixed
Parameters
$values : array<string|int, mixed>

Array of [key => value] to assign to the form

$keys : array<string|int, mixed>

Array of keys to assign from the values array

buildForm()

Core function that builds the form.

public buildForm() : mixed

We redefine this function here and expect all CRM forms to build their form in the function buildQuickForm.

buildValuesAndAssignOnline_Note_Type()

public buildValuesAndAssignOnline_Note_Type(int $id, mixed &$values) : mixed
Parameters
$id : int
$values : mixed

cancelAction()

Function that can be defined in Form to override or.

public cancelAction() : mixed

perform specific action on cancel action

canUseAjaxContactLookups()

public canUseAjaxContactLookups() : bool
Return values
bool

createHiddenGroup()

Given this task's list of targets, produce a hidden group.

public createHiddenGroup() : array<string|int, mixed>
Tags
throws
Exception
Return values
array<string|int, mixed>

Array(0 => int $groupID, 1 => int|NULL $ssID).

error()

Error reporting mechanism.

public error(string $message[, int $code = NULL ][, CRM_Core_DAO $dao = NULL ]) : mixed
Parameters
$message : string

Error Message.

$code : int = NULL

Error Code.

$dao : CRM_Core_DAO = NULL

A data access object on which we perform a rollback if non - empty.

formatCreditCardDetails()

Format credit card details like: 1. Retrieve last 4 digit from credit card number as pan_truncation 2. Retrieve credit card type id from name

public static formatCreditCardDetails(array<string|int, mixed> &$params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>
Return values
array<string|int, mixed>

An array of params suitable for assigning to the form/tpl

formRule()

Global validation rules for the form.

public static formRule(array<string|int, mixed> $values, mixed $files, self $self) : array<string|int, mixed>|true
Parameters
$values : array<string|int, mixed>

Posted values of the form.

$files : mixed
$self : self
Return values
array<string|int, mixed>|true

list of errors to be posted back to the form

get()

Get the variable from the form scope.

public get(string $name) : mixed
Parameters
$name : string

Name of the variable

get_template_vars()

Returns an array containing template variables.

public get_template_vars([string $name = NULL ]) : array<string|int, mixed>

since 5.69 will be removed around 5.93. use getTemplateVars.

Parameters
$name : string = NULL
Return values
array<string|int, mixed>

getAction()

Getter for action.

public getAction() : int|null
Return values
int|null

getAuthenticatedContactID()

Get the authenticated contact ID.

public getAuthenticatedContactID() : int
APIYes

This is either

  • a contact ID authenticated by checksum
  • the logged in user
  • 0 for none.
Tags
throws
CRM_Core_Exception
Return values
int

getCompleteTitle()

public getCompleteTitle() : string
Return values
string

getContactID()

Get the contact ID in use.

public getContactID() : int|null

Ideally override this as appropriate to the form.

Tags
noinspection

PhpUnhandledExceptionInspection

noinspection

PhpDocSignatureIsNotCompleteInspection

Return values
int|null

getContactIDsFromComponent()

Given the component id, compute the contact id since it's used for things like send email.

public getContactIDsFromComponent(mixed $componentIDs, string $tableName[, string $idField = 'id' ]) : array<string|int, mixed>
Parameters
$componentIDs : mixed
$tableName : string
$idField : string = 'id'
Tags
todo

At the moment this duplicates a similar function in CRM_Core_DAO because right now only the case component is using this. Since the default $orderBy is '' which is what the original does, others should be easily convertable as NFC.

todo

The passed in variables should be class member variables. Shouldn't need to have passed in vars.

Return values
array<string|int, mixed>

getContactValue()

Get a value for the contact being acted on in the form.

public getContactValue(mixed $fieldName) : mixed

This can be called from any point in the form flow and if the contact can not yet be determined it will return NULL.

Parameters
$fieldName : mixed
Tags
throws
CRM_Core_Exception

getContext()

public getContext() : string
Return values
string

getContributionID()

Get the contribution ID.

public getContributionID() : int|null
APIYes
Return values
int|null

getCurrency()

Get the currency for the event.

public getCurrency() : string
Tags
noinspection

PhpDocMissingThrowsInspection

Return values
string

getDefaultContext()

Default form context used as part of addField()

public getDefaultContext() : string
Return values
string

getDefaultEntity()

Explicitly declare the entity api name.

public getDefaultEntity() : string
Return values
string

getDiscountID()

Get the discount ID.

public getDiscountID() : int|null
APIYes
Tags
noinspection

PhpDocMissingThrowsInspection

noinspection

PhpUnhandledExceptionInspection

Return values
int|null

getDistinctComponentClause()

Get the clause for grouping by the component.

public getDistinctComponentClause() : string
Return values
string

getEntityAliasField()

Get the group by clause for the component.

public getEntityAliasField() : string
Return values
string

getEventID()

Get the selected Event ID.

public getEventID() : int|null
APIYes
Return values
int|null

getEventValue()

Get the value for a field relating to the event.

public getEventValue(string $fieldName) : mixed
APIYes

All values returned in apiv4 format. Escaping may be required.

Parameters
$fieldName : string
Tags
throws
CRM_Core_Exception

getFeeDetails()

Get the event fee info for given participant ids either from line item table / participant table.

public getFeeDetails(array<string|int, mixed> $participantIds[, bool $hasLineItems = FALSE ]) : array<string|int, mixed>
Parameters
$participantIds : array<string|int, mixed>

Participant ids.

$hasLineItems : bool = FALSE

Do fetch from line items.

Tags
throws
DBQueryException
Return values
array<string|int, mixed>

getFormContext()

Get the form context.

public getFormContext() : string

This is important for passing to the buildAmount hook as CiviDiscount checks it.

Return values
string

getGroupByComponentClause()

Get the group by clause for the component.

public getGroupByComponentClause() : string
Return values
string

getHookedTemplateFileName()

A wrapper for getTemplateFileName.

public getHookedTemplateFileName() : mixed

This includes calling the hook to prevent us from having to copy & paste the logic of calling the hook.

getInvoiceID()

Get the unique invoice ID.

public getInvoiceID() : string
Return values
string

getLineItems()

Get the selected line items.

public getLineItems() : array<string|int, mixed>
APIYes
Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

getLoggedInUserContactID()

Get the contact id of the logged in user.

public getLoggedInUserContactID() : int|false
Return values
int|false

getName()

Getter function for Name.

public getName() : string
Return values
string

getOptionalQuickFormElements()

Get any quick-form elements that may not be present in the form.

public getOptionalQuickFormElements() : array<string|int, mixed>

To make life simpler for smarty we ensure they are set to null rather than unset. This is done at the last minute when $this is converted to an array to be assigned to the form.

Return values
array<string|int, mixed>

getParticipantID()

Get id of participant being edited.

public getParticipantID() : int|null
APIYes
Tags
noinspection

PhpUnhandledExceptionInspection

noinspection

PhpDocMissingThrowsInspection

Return values
int|null

getParticipantValue()

Get a value from the participant being acted on.

public getParticipantValue(string $fieldName) : mixed
APIYes

All values returned in apiv4 format. Escaping may be required.

Parameters
$fieldName : string
Tags
throws
CRM_Core_Exception

getPaymentProcessorID()

public getPaymentProcessorID() : int|null
Return values
int|null

getPriceFieldMetaData()

Get price field metadata.

public getPriceFieldMetaData() : array<string|int, mixed>
APIYes

The returned value is an array of arrays where each array is an id-keyed price field and an 'options' key has been added to that arry for any options.

Return values
array<string|int, mixed>

getPriceSetID()

Get the Price Set ID in use.

public getPriceSetID() : int|null
APIYes
Tags
noinspection

PhpDocMissingThrowsInspection

noinspection

PhpUnhandledExceptionInspection

Return values
int|null

getProfileDefaults()

Set default values on form for given contact (or no contact defaults)

public getProfileDefaults([mixed $profile_id = 'Billing' ][, int $contactID = NULL ]) : array<string|int, mixed>
Parameters
$profile_id : mixed = 'Billing'

(can be id, or profile name).

$contactID : int = NULL
Return values
array<string|int, mixed>

getQueryMode()

Get the query mode (eg. CRM_Core_BAO_Query::MODE_CASE) Should be overridden by child classes in most cases

public getQueryMode() : int
Return values
int

getRequestedContactID()

Get the contact ID that has been requested (via url or form value).

public getRequestedContactID() : int|null

Ideally the forms would override this so only the cid in the url would be checked in the shared form function.

Tags
throws
CRM_Core_Exception
Return values
int|null

getRootTitle()

public getRootTitle() : null
Return values
null

getSalesTaxTerm()

Return the string to be assigned to the template for sales tax - e.g GST, VAT.

public getSalesTaxTerm() : string
Return values
string

getSearchFormValues()

Get the submitted values for the form.

public getSearchFormValues() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSelectedIDs()

Get the ids the user has selected or an empty array if selection has not been used.

public getSelectedIDs(array<string|int, mixed> $values) : array<string|int, mixed>
Parameters
$values : array<string|int, mixed>
Return values
array<string|int, mixed>

getState()

Getter function for State.

public & getState() : object
Return values
object

getStateType()

Getter function for StateType.

public getStateType() : int
Return values
int

getSubmittedValue()

Get value submitted by the user.

public getSubmittedValue(string $fieldName) : mixed|null
APIYes

These values have been validated against the fields added to the form. https://pear.php.net/manual/en/package.html.html-quickform.html-quickform.exportvalues.php unless the function is being called during before the submission has been validated. In which the values are not yet validated & hence taking directly from $_POST.

Fields with money or number formats are converted from localised formats before returning.

Parameters
$fieldName : string
Return values
mixed|null

getSubmittedValues()

Get values submitted by the user.

public getSubmittedValues() : array<string|int, mixed>
APIYes

Compared with $this->controller->exportValues this has a couple of changes

  1. any fields declared in $this->submittableMoneyFields will be de-formatted first.
  2. it is possible to store access fields from related forms if they are declared in getSubmittableFields(). This is notably used in imports to combine fields from the various screens & save the resulting 'submitted_values' to the UserJob.
Return values
array<string|int, mixed>

getTableName()

Get the name of the table for the relevant entity.

public getTableName() : string
Return values
string

getTaxRateForFinancialType()

public getTaxRateForFinancialType(int $financialTypeID) : string
Parameters
$financialTypeID : int
Return values
string

getTaxRatesForFinancialTypes()

Get sales tax rates.

public getTaxRatesForFinancialTypes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTemplateFileName()

Use the form name to create the tpl file name.

public getTemplateFileName() : string
Return values
string

getTemplateVars()

Get the value/s assigned to the Template Engine (Smarty).

public getTemplateVars([string|null $name = NULL ]) : mixed
Parameters
$name : string|null = NULL

getTitle()

Getter function for title.

public getTitle() : string

Should be over-ridden by derived class.

Return values
string

getUFGroupIDs()

Get the active UFGroups (profiles) on this form Many forms load one or more UFGroups (profiles).

public getUFGroupIDs() : array<string|int, mixed>

This provides a standard function to retrieve the IDs of those profiles from the form so that you can implement things such as "is is_captcha field set on any of the active profiles on this form?"

NOT SUPPORTED FOR USE OUTSIDE CORE EXTENSIONS - Added for reCAPTCHA core extension.

Return values
array<string|int, mixed>

getValidProcessors()

public getValidProcessors() : array<string|int, mixed>
Tags
throws
Exception
Return values
array<string|int, mixed>

Array of valid processors. The array resembles the DB table but also has 'object' as a key

getVar()

public getVar(string $name) : mixed
  • use of this function assumes that an otherwise unavailable variable can be used form outside the class in question. However, the very fact it is otherwise unavailable means there is no contract that it will not be changed or become unused. This function is OK for temporary usage but should be accompanied with an effort to establish a more correct method or property tested hook / api interface if this is being done from outside of core.
Parameters
$name : string

isDefined()

Check if an entity can be looked up

public isDefined(string $nickname) : bool
Parameters
$nickname : string
Return values
bool

isEventFull()

Is the event full already.

public isEventFull() : bool
APIYes

This function may be calculated by v4 api in time, in which case the function will call that instead but will remain available.

Tags
throws
CRM_Core_Exception
Return values
bool

isFormInEditMode()

Is the form in edit mode.

public isFormInEditMode() : bool

Helper function, notably for extensions implementing the buildForm hook, so that they can return early.

Return values
bool

isFormInViewMode()

Is the form in view mode.

public isFormInViewMode() : bool

Helper function, notably for extensions implementing the buildForm hook, so that they can return early.

Return values
bool

isQuickConfig()

Is the price set quick config.

public isQuickConfig() : bool
Return values
bool

isTest()

Is the form being submitted in test mode.

public isTest() : bool
APIYes
Return values
bool

listTokens()

List available tokens for this form.

public listTokens() : array<string|int, mixed>
Return values
array<string|int, mixed>

lookup()

Retrieve a field value for a defined entity

public lookup(string $nickname, string $fieldName) : mixed
Parameters
$nickname : string

Handle set by $this->define()

$fieldName : string
Tags
throws
CRM_Core_Exception

mainProcess()

Main process wrapper.

public mainProcess([bool $allowAjax = TRUE ]) : mixed

Implemented so that we can call all the hook functions.

Parameters
$allowAjax : bool = TRUE

FIXME: This feels kind of hackish, ideally we would take the json-related code from this function. and bury it deeper down in the controller

orderBy()

Default ordering for getContactIDsFromComponent. Subclasses can override.

public orderBy() : string
Return values
string

SQL fragment. Either return '' or a valid order clause including the words "ORDER BY", e.g. "ORDER BY {$this->idField}"

overrideExtraTemplateFileName()

Default extra tpl file basically just replaces .tpl with .extra.tpl.

public overrideExtraTemplateFileName() : string

i.e. we do not override.

Return values
string

postProcess()

Process the form submission.

public postProcess() : mixed

postProcessHook()

The postProcess hook is typically called by the framework.

public postProcessHook() : mixed

However in a few cases, the form exits or redirects early in which case it needs to call this function so other modules can do the needful Calling this function directly should be avoided if possible. In general a better way is to do setUserContext so the framework does the redirect

preventAjaxSubmit()

Sets form attribute.

public preventAjaxSubmit() : mixed
Tags
see

CRM.loadForm

registerFileField()

Register a field with quick form as supporting a file upload.

public registerFileField(array<string|int, mixed> $fieldNames) : void
Parameters
$fieldNames : array<string|int, mixed>

registerRules()

Register all the standard rules that most forms potentially use.

public registerRules() : mixed

removeFileRequiredRules()

public removeFileRequiredRules(mixed $elementName) : mixed
Parameters
$elementName : mixed

resetValues()

public resetValues() : mixed

set()

Store the variable with the value in the form scope.

public set(string $name, mixed $value) : mixed
Parameters
$name : string

Name of the variable.

$value : mixed

Value of the variable.

setAction()

Setter for action.

public setAction(int $action) : mixed
Parameters
$action : int

The mode we want to set the form.

setContactIDs()

Given the entity id, compute the contact id since its used for things like send email For example, for cases we need to override this function as the table name is civicrm_case_contact

public setContactIDs() : mixed

setContext()

Set context variable.

public setContext() : mixed

setDefaultValues()

This function sets the default values for the form in edit/view mode the default values are retrieved from the database

public setDefaultValues() : array<string|int, mixed>
Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

setNextUrl()

Set where the browser should be directed to next.

public setNextUrl(string $pathPart) : mixed
Parameters
$pathPart : string
Tags
throws
CRM_Core_Exception

setOptions()

Setter function for options.

public setOptions(mixed $options) : mixed
Parameters
$options : mixed

setPageTitle()

Sets page title based on entity and action.

public setPageTitle([string|null $entityLabel = NULL ]) : void
Parameters
$entityLabel : string|null = NULL
Tags
throws
CRM_Core_Exception

setPurifiedDefaults()

public setPurifiedDefaults(mixed $defaults) : mixed
Parameters
$defaults : mixed

setSelectedChild()

Set the active tab

public setSelectedChild([string $default = NULL ]) : mixed
Parameters
$default : string = NULL
Tags
noinspection

PhpUnhandledExceptionInspection

setTitle()

Setter function for title.

public setTitle(string $title) : mixed
Parameters
$title : string

The title of the form.

setVar()

public setVar(string $name, mixed $value) : mixed
  • use of this function assumes that an otherwise unavailable variable can be used form outside the class in question. However, the very fact it is otherwise unavailable means there is no contract that it will not be changed or become unused. This function is OK for temporary usage but should be accompanied with an effort to establish a more correct method or property tested hook / api interface if this is being done from outside of core.
Parameters
$name : string
$value : mixed

showRecordLinkMesssage()

public showRecordLinkMesssage(int $id) : mixed
Parameters
$id : int

toSmarty()

Render form and return contents.

public toSmarty() : string
Return values
string

unsetCreditCardFields()

public unsetCreditCardFields(array<string|int, mixed> $submittedValues) : mixed
Parameters
$submittedValues : array<string|int, mixed>

validate()

Performs the server side validation.

public validate() : bool
Tags
since
1.0
throws
HTML_QuickForm_Error
Return values
bool

true if no error found

validateMandatoryFields()

Helper function to verify that required fields have been filled.

public static validateMandatoryFields(array<string|int, mixed> $fields, array<string|int, mixed> $values, array<string|int, mixed> &$errors) : mixed

Typically called within the scope of a FormRule function

Parameters
$fields : array<string|int, mixed>
$values : array<string|int, mixed>
$errors : array<string|int, mixed>

addPaymentProcessorSelect()

Add the payment processor select to the form.

protected addPaymentProcessorSelect(bool $isRequired[, bool $isBuildRecurBlock = FALSE ][, bool $isBuildAutoRenewBlock = FALSE ]) : mixed
Parameters
$isRequired : bool

Is it a mandatory field.

$isBuildRecurBlock : bool = FALSE

True if we want to build recur on change

$isBuildAutoRenewBlock : bool = FALSE

True if we want to build autorenew on change.

assignEventDetailsToTpl()

protected assignEventDetailsToTpl(mixed $eventID, mixed $participantRoles, mixed $receiptText) : void
Parameters
$eventID : mixed
$participantRoles : mixed
$receiptText : mixed
Tags
throws
CRM_Core_Exception

assignPaymentInfoBlock()

Assign the values to build the payment info block.

protected assignPaymentInfoBlock() : mixed

assignPaymentProcessor()

This if a front end form function for setting the payment processor.

protected assignPaymentProcessor(bool $isPayLaterEnabled) : mixed

It would be good to sync it with the back-end function on abstractEditPayment & use one everywhere.

Parameters
$isPayLaterEnabled : bool
Tags
throws
CRM_Core_Exception

assignPaymentRelatedVariables()

Common block for setting up the parts of a form that relate to credit / debit card

protected assignPaymentRelatedVariables() : mixed

assignUrlPath()

Assign the url path to the template.

protected assignUrlPath() : mixed

beginPostProcess()

Begin post processing.

protected beginPostProcess() : mixed

This function aims to start to bring together common postProcessing functions.

Eventually these are also shared with the front end forms & may need to be moved to where they can also access this function.

define()

Defines a record so its values can be retrieved using `$this->lookup()`

protected define(string $apiEntityName, string $nickname, array<string|int, mixed> $identifier) : void
Parameters
$apiEntityName : string
$nickname : string

Handle to use to retrieve values with $this->lookup()

$identifier : array<string|int, mixed>

A unique key or combination of keys to uniquely identify the record (usually id) Most commonly looks like ['id' => 123]

formatParamsForPaymentProcessor()

Format the fields in $this->_params for the payment processor.

protected formatParamsForPaymentProcessor(array<string|int, mixed> $fields) : array<string|int, mixed>

In order to pass fields to the payment processor in a consistent way we add some renamed parameters.

Parameters
$fields : array<string|int, mixed>
Return values
array<string|int, mixed>

getApiAction()

Based on form action, return a string representing the api action.

protected getApiAction() : mixed

Used by addField method.

Return string

getAuthenticatedCheckSumContactID()

Get the contact ID authenticated as a valid by checksum.

protected getAuthenticatedCheckSumContactID() : int
Tags
throws
CRM_Core_Exception
Return values
int

getAvailableFromEmails()

Get the emails available for the from address.

protected getAvailableFromEmails() : array<string|int, mixed>
Return values
array<string|int, mixed>

getBillingDefaults()

Get default values for billing fields.

protected getBillingDefaults(mixed $defaults) : array<string|int, mixed>
Parameters
$defaults : mixed
Tags
todo

this function still replicates code in several other places in the code.

Also - the call to getProfileDefaults possibly covers the state_province & country already.

Return values
array<string|int, mixed>

getContactIDIfAccessingOwnRecord()

Get the contact if from the url, using the checksum or the cid if it is the logged in user.

protected getContactIDIfAccessingOwnRecord() : int|false

use getAuthenticatedContactID()

This function returns the user being validated. It is not intended to get another user they have permission to (setContactID does do that) and can be used to check if the user is accessing their own record.

Tags
throws
CRM_Core_Exception
Return values
int|false

getContactIDs()

Get the relevant contact IDs.

protected getContactIDs() : array<string|int, mixed>
Return values
array<string|int, mixed>

getCreatePaymentParams()

Get params to create payments.

protected getCreatePaymentParams() : array<string|int, mixed>
Return values
array<string|int, mixed>

getDefaultPaymentInstrumentId()

Get the default payment instrument id.

protected getDefaultPaymentInstrumentId() : int

This priortises the submitted value, if any and falls back on the processor.

Tags
throws
CRM_Core_Exception
Return values
int

getDefinition()

Retrieve entity definition (entityName string, identifier [keys/values])

protected getDefinition(string $nickname) : array{entityName: string, identifier: array}|null
Parameters
$nickname : string
Return values
array{entityName: string, identifier: array}|null

getFieldsToExcludeFromPurification()

Override this in a subclass to prevent fields intended to contain "raw html" from getting broken. E.g. system message templates

protected getFieldsToExcludeFromPurification() : array<string|int, mixed>
Return values
array<string|int, mixed>

getOrder()

Get the order object, if the event is paid.

protected getOrder() : CRM_Financial_BAO_Order|null
Tags
throws
CRM_Core_Exception
Return values
CRM_Financial_BAO_Order|null

getRevenueRecognitionDate()

Get the value for the revenue recognition date field.

protected getRevenueRecognitionDate() : string
Tags
throws
CRM_Core_Exception
Return values
string

getRows()

Get the rows from the results.

protected getRows() : array<string|int, mixed>
Return values
array<string|int, mixed>

getStatusMsg()

Get status message

protected getStatusMsg(array<string|int, mixed> $params, int $numberSent, int $numberNotSent, string $updateStatusMsg) : string
Parameters
$params : array<string|int, mixed>
$numberSent : int
$numberNotSent : int
$updateStatusMsg : string
Return values
string

getSubmittableFields()

Get the fields that can be submitted in this form flow.

protected getSubmittableFields() : array<string|int, string>
APIYes

To make fields in related forms (ie within the same wizard like Contribution_Main and Contribution_Confirm) accessible you can override this function as CRM_Import_Forms does.

Return values
array<string|int, string>

getTokenSchema()

Get the token processor schema required to list any tokens for this task.

protected getTokenSchema() : array<string|int, mixed>
Return values
array<string|int, mixed>

handlePreApproval()

Handle pre approval for processors.

protected handlePreApproval(array<string|int, mixed> &$params) : mixed

This fits with the flow where a pre-approval is done and then confirmed in the next stage when confirm is hit.

This function is shared between contribution & event forms & this is their common class.

However, this should be seen as an in-progress refactor, the end goal being to also align the backoffice forms that action payments.

Parameters
$params : array<string|int, mixed>

isFormInViewOrEditMode()

Is the form in view or edit mode.

protected isFormInViewOrEditMode() : bool

The 'addField' function relies on the form action being one of a set list of actions. Checking for these allows for an early return.

Return values
bool

isOverloadFeesMode()

Is the form being accessed in overload fees mode.

protected isOverloadFeesMode() : bool

Overload fees mode is when we are accessing the same form for a different purpose - to load the fees via ajax. We have historically fixed this for some forms by creating a new form class to move the functionality to and updating the path to call that (e.g CRM_Financial_Form_Payment was historically split in this way).

This is much cleaner but the trap to be aware of is that the fields must be added to the quick form. It does require a bit of UI testing to do this. For now, adding comment...

Return values
bool

isPaymentOnExistingContribution()

Is a payment being made on an existing contribution.

protected isPaymentOnExistingContribution() : bool

Note

  1. ideally we should not permit this on this form! Perhaps we don't & this is just cruft.
  2. _paymentID is the contribution id.
Tags
throws
CRM_Core_Exception
Return values
bool

legacyGetContactIds()

Get the contact ids for: - "Select Records: All xx records" - custom search (FIXME: does this still apply to custom search?).

protected static legacyGetContactIds(CRM_Core_Form_Task $form) : array<string|int, mixed>

When we call this function we are not using the prev/next cache

We've started to try to move away from these functions being static. Probably we need to convert the export forms to use a trait based approach. For now this is renamed to permit the use of a non-static function with this name

Parameters
$form : CRM_Core_Form_Task
Return values
array<string|int, mixed>

$contactIds

preparePaidEventProcessing()

Extracted code relating to paid events.

protected preparePaidEventProcessing(mixed $params) : array<string|int, mixed>
Parameters
$params : mixed
Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

prepareParamsForPaymentProcessor()

Format the fields in $params for the payment processor.

protected prepareParamsForPaymentProcessor(array<string|int, mixed> $params) : array<string|int, mixed>

In order to pass fields to the payment processor in a consistent way we add some renamed parameters.

Parameters
$params : array<string|int, mixed>

Payment processor params

Return values
array<string|int, mixed>

$params

preProcessPaymentOptions()

Handle Payment Processor switching for contribution and event registration forms.

protected preProcessPaymentOptions() : mixed

This function is shared between contribution & event forms & this is their common class.

However, this should be seen as an in-progress refactor, the end goal being to also align the backoffice forms that action payments.

This function overlaps assignPaymentProcessor, in a bad way.

processBillingAddress()

Add the billing address to the contact who paid.

protected processBillingAddress(int $contactID, string $email) : void

Note that this function works based on the presence or otherwise of billing fields & can be called regardless of whether they are 'expected' (due to assumptions about the payment processor type or the setting to collect billing for pay later.

Parameters
$contactID : int
$email : string
Tags
throws
CRM_Core_Exception
throws
UnauthorizedException

processContribution()

Process the contribution.

protected processContribution(array<string|int, mixed> $result, int $contactID[, bool $pending = FALSE ][, array<string|int, mixed> $paymentProcessor = NULL ]) : CRM_Contribute_BAO_Contribution
Parameters
$result : array<string|int, mixed>
$contactID : int
$pending : bool = FALSE
$paymentProcessor : array<string|int, mixed> = NULL
Tags
throws
CRM_Core_Exception
Return values
CRM_Contribute_BAO_Contribution

pushUrlToUserContext()

Push path to the userContext (defaults to current url path).

protected pushUrlToUserContext([string|null $path = NULL ]) : void

This is like a save point :-). The next status bounce will return the browser to this url unless another is added.

Parameters
$path : string|null = NULL

Path string e.g. civicrm/foo/bar?reset=1, defaults to current path.

sendReceipts()

protected sendReceipts(mixed $params, array<string|int, mixed> $participants) : array<string|int, mixed>
Parameters
$params : mixed
$participants : array<string|int, mixed>
Tags
throws
CRM_Core_Exception
throws
UnknownCurrencyException
Return values
array<string|int, mixed>

setContactID()

Get contact iD for a form object.

protected setContactID() : null|int

This checks the requestedContactID and returns it if

  • it is the number 0 (relevant for online contribution & event forms).
  • it is the logged in user
  • it is validated by a checksum in the url.
  • it is a contact that the logged in user has permission to view

Failing that it returns the logged in user, if any. This is may be useful for users taking actions from their contact dashboard (although usually one of the variants above would be hit).

Tags
throws
CRM_Core_Exception
Return values
null|int

setCreatePaymentParams()

Set params to create payments.

protected setCreatePaymentParams(array<string|int, mixed> $createPaymentParams) : void
Parameters
$createPaymentParams : array<string|int, mixed>

setTranslatedFields()

Set translated fields.

protected setTranslatedFields() : mixed

This function is called from the class constructor, allowing us to set fields on the class that can't be set as properties due to need for translation or other non-input specific handling.

storePaymentCreateParams()

Store the parameters to create a payment, if appropriate, on the form.

protected storePaymentCreateParams(array<string|int, mixed> $params) : void
Parameters
$params : array<string|int, mixed>

Params as submitted.

validateAuthenticatedCheckSumContactID()

Verify that a contact ID is authenticated as a valid contact by checksum

protected validateAuthenticatedCheckSumContactID(int|null $contactID) : int
Parameters
$contactID : int|null
Tags
throws
CRM_Core_Exception
Return values
int

formatReferenceFieldAttributes()

private formatReferenceFieldAttributes(array<string|int, mixed> &$props, string $formName) : mixed
Parameters
$props : array<string|int, mixed>
$formName : string

getExtendsEntityColumnID()

Get the relevant mapping for civicrm_custom_group.extends_entity_column_value.

private getExtendsEntityColumnID(string $type) : int|null
Parameters
$type : string
Return values
int|null

getSelectedContactNames()

private static getSelectedContactNames() : array<string|int, mixed>
Return values
array<string|int, mixed>

List of contact names. NOTE: These are raw values from the DB. In current data-model, that means they are pre-encoded HTML.

getSourceText()

Get the text for the participant & contribution source fields.

private getSourceText() : string
Tags
throws
CRM_Core_Exception
Return values
string

preProcessChainSelectFields()

Set options and attributes for chain select fields based on the controlling field's value

private preProcessChainSelectFields() : mixed

selectOrAnyPlaceholder()

Handles a repeated bit supplying a placeholder for entity selection

private static selectOrAnyPlaceholder(string $props, bool $required[, string $title = NULL ]) : string
Parameters
$props : string

The field properties, including the entity and context.

$required : bool

If the field is required.

$title : string = NULL

A field title, if applicable.

Return values
string

The placeholder text.

validateChainSelectFields()

Validate country / state / county match and suppress unwanted "required" errors

private validateChainSelectFields() : mixed

        
On this page

Search results