function wf_crm_find_custom_refs in Webform CiviCRM Integration 7.5
Same name and namespace in other branches
- 7.4 includes/contact_component.inc \wf_crm_find_custom_refs()
Returns ids of all contacts who have reference to given contact via given custom field id
Parameters
$cid:
$customFieldID:
Return value
array
1 call to wf_crm_find_custom_refs()
- wf_crm_webform_base::findContact in includes/
wf_crm_webform_base.inc - Find an existing contact based on matching criteria Used to populate a webform existing contact field
File
- includes/
contact_component.inc, line 969
Code
function wf_crm_find_custom_refs($cid, $customFieldID) {
$filters = [
'return' => [
'custom_' . $customFieldID,
],
'id' => $cid,
];
$result = wf_civicrm_api('Contact', 'get', $filters);
if (isset($result['values'][$cid]['custom_' . $customFieldID])) {
return [
$result['values'][$cid]['custom_' . $customFieldID] => $result['values'][$cid]['custom_' . $customFieldID],
];
}
return [];
}