class CRM_Custom_Form_CustomData

this class builds custom data

Methods

static 
addToForm(CRM_Core_Form $form, null|string $subType = NULL, null|string $subName = NULL, null|int $groupCount = 1, null|int $contact_id = NULL)

Generic wrapper to add custom data to a form via a single line in preProcess.

static 
preProcess(CRM_Core_Form $form, null|string $subName = NULL, null|string $subType = NULL, null|int $groupCount = NULL, string $type = NULL, null|int $entityID = NULL, null $onlySubType = NULL)

No description

static array
setDefaultValues(CRM_Core_Form $form)

No description

static 
buildQuickForm(CRM_Core_Form $form)

No description

static array
setGroupTree(CRM_Core_Form $form, string $subType, int $gid, bool $onlySubType = NULL, bool $getCachedTree = TRUE)

Add the group data as a formatted array to the form.

Details

at line 56
static addToForm(CRM_Core_Form $form, null|string $subType = NULL, null|string $subName = NULL, null|int $groupCount = 1, null|int $contact_id = NULL)

Generic wrapper to add custom data to a form via a single line in preProcess.

$this->getDefaultEntity() must be defined for the form class for this to work.

If the postProcess form cannot use the api & instead uses a BAO function it will need. $params['custom'] = CRM_Core_BAO_CustomField::postProcess($submitted, $this->_id, $this->getDefaultEntity());

Parameters

CRM_Core_Form $form
null|string $subType values stored in civicrm_custom_group.extends_entity_column_value e.g Student for contact type
null|string $subName value in civicrm_custom_group.extends_entity_column_id
null|int $groupCount number of entities that could have custom data
null|int $contact_id contact ID associated with the custom data.

Exceptions

CRM_Core_Exception

at line 98
static preProcess(CRM_Core_Form $form, null|string $subName = NULL, null|string $subType = NULL, null|int $groupCount = NULL, string $type = NULL, null|int $entityID = NULL, null $onlySubType = NULL)

Parameters

CRM_Core_Form $form
null|string $subName
null|string $subType
null|int $groupCount
string $type
null|int $entityID
null $onlySubType

Exceptions

CRM_Core_Exception

at line 177
static array setDefaultValues(CRM_Core_Form $form)

Parameters

CRM_Core_Form $form

Return Value

array

at line 186
static buildQuickForm(CRM_Core_Form $form)

Parameters

CRM_Core_Form $form

at line 204
static array setGroupTree(CRM_Core_Form $form, string $subType, int $gid, bool $onlySubType = NULL, bool $getCachedTree = TRUE)

Add the group data as a formatted array to the form.

Parameters

CRM_Core_Form $form
string $subType
int $gid
bool $onlySubType
bool $getCachedTree

Return Value

array

Exceptions

CRM_Core_Exception