function wf_crm_required_contact_fields in Webform CiviCRM Integration 7.5
Same name and namespace in other branches
- 7.3 webform_civicrm_utils.inc \wf_crm_required_contact_fields()
- 7.4 includes/utils.inc \wf_crm_required_contact_fields()
At least one of these fields is required to create a contact
Parameters
string $contact_type:
Return value
array of fields
2 calls to wf_crm_required_contact_fields()
- wf_crm_name_field_exists in includes/
utils.inc - Check if a (non-disabled) name or email field exists for this contact. This determines whether a new contact can be created on the webform.
- wf_crm_webform_postprocess::isContactEmpty in includes/
wf_crm_webform_postprocess.inc - Check if at least one required field was filled for a contact
File
- includes/
utils.inc, line 1743 - Webform CiviCRM module's common utility functions.
Code
function wf_crm_required_contact_fields($contact_type) {
if ($contact_type == 'individual') {
return [
[
'table' => 'email',
'name' => 'email',
],
[
'table' => 'contact',
'name' => 'first_name',
],
[
'table' => 'contact',
'name' => 'last_name',
],
];
}
return [
[
'table' => 'contact',
'name' => $contact_type . '_name',
],
];
}