CRM_Contact_Form_Edit_Address
in package
This class is used to build address block.
Table of Contents
Methods
- buildQuickForm() : mixed
- Build form for address input fields.
- formRule() : array<string|int, mixed>|bool
- Check for correct state / country mapping.
- setDefaultValues() : mixed
- Set default values for address block.
- addCustomDataToForm() : mixed
- Add custom data to the form.
- enforceRequired() : bool
- Should required fields be enforced.
Methods
buildQuickForm()
Build form for address input fields.
public
static buildQuickForm(CRM_Core_Form &$form[, int $addressBlockCount = NULL ][, bool $sharing = TRUE ][, bool $inlineEdit = FALSE ]) : mixed
Parameters
- $form : CRM_Core_Form
- $addressBlockCount : int = NULL
-
The index of the address array (if multiple addresses on a page).
- $sharing : bool = TRUE
-
False, if we want to skip the address sharing features.
- $inlineEdit : bool = FALSE
-
True when edit used in inline edit.
Tags
formRule()
Check for correct state / country mapping.
public
static formRule(array<string|int, mixed> $fields[, array<string|int, mixed> $files = [] ][, CRM_Core_Form $self = NULL ]) : array<string|int, mixed>|bool
Parameters
- $fields : array<string|int, mixed>
- $files : array<string|int, mixed> = []
- $self : CRM_Core_Form = NULL
Return values
array<string|int, mixed>|bool —if no errors
setDefaultValues()
Set default values for address block.
public
static setDefaultValues(array<string|int, mixed> &$defaults, CRM_Contact_Form_Contact|CRM_Contact_Form_Edit_Address &$form) : mixed
Parameters
- $defaults : array<string|int, mixed>
-
Defaults associated array.
- $form : CRM_Contact_Form_Contact|CRM_Contact_Form_Edit_Address
-
Form object.
addCustomDataToForm()
Add custom data to the form.
protected
static addCustomDataToForm(CRM_Core_Form &$form, int $entityId, int $blockId) : mixed
Parameters
- $form : CRM_Core_Form
- $entityId : int
- $blockId : int
Tags
enforceRequired()
Should required fields be enforced.
private
static enforceRequired(CRM_Core_Form $form) : bool
This would be FALSE if there were no other address fields present.
Parameters
- $form : CRM_Core_Form