function wf_crm_display_name in Webform CiviCRM Integration 7.5
Same name and namespace in other branches
- 7.3 webform_civicrm_utils.inc \wf_crm_display_name()
- 7.4 includes/utils.inc \wf_crm_display_name()
Fetch contact display name
Parameters
$cid: Contact id
Return value
string
5 calls to wf_crm_display_name()
- wf_crm_admin_component::preprocessComponentsForm in includes/
wf_crm_admin_component.inc - Add CiviCRM info and theming to webform components form.
- wf_crm_webform_postprocess::tallyLineItems in includes/
wf_crm_webform_postprocess.inc - Calculate line-items for this webform submission
- _webform_csv_data_civicrm_contact in includes/
contact_component.inc - Implements _webform_csv_data_component().
- _webform_display_civicrm_contact in includes/
contact_component.inc - Implements _webform_display_component().
- _webform_table_civicrm_contact in includes/
contact_component.inc - Implements _webform_table_component().
File
- includes/
utils.inc, line 1546 - Webform CiviCRM module's common utility functions.
Code
function wf_crm_display_name($cid) {
if (!$cid || !is_numeric($cid)) {
return '';
}
civicrm_initialize();
$result = wf_civicrm_api('contact', 'get', [
'id' => $cid,
'return.display_name' => 1,
'is_deleted' => 0,
]);
return check_plain(wf_crm_aval($result, "values:{$cid}:display_name", ''));
}