You are here

function wf_crm_get_custom_ref_options in Webform CiviCRM Integration 7.4

Same name and namespace in other branches
  1. 7.5 includes/contact_component.inc \wf_crm_get_custom_ref_options()

Returns a list of all custom CiviCRM fields of type "ContactReference"

Return value

array

1 call to wf_crm_get_custom_ref_options()
_webform_edit_civicrm_contact in includes/contact_component.inc
Implements _webform_edit_component().

File

includes/contact_component.inc, line 948

Code

function wf_crm_get_custom_ref_options() {
  $filters = array(
    'sequential' => 1,
    'return' => [
      "id",
      "label",
    ],
    'data_type' => "ContactReference",
  );
  $result = wf_civicrm_api('CustomField', 'get', $filters);
  $options = array();
  foreach ($result['values'] as $val) {
    $options[$val['id']] = $val['label'];
  }
  return $options;
}