function Utils::wf_crm_apivalues in Webform CiviCRM Integration 8.5
Get the values from an api call
Parameters
string $entity: API entity
string $operation: API operation
array $params: API params
string $value: Reduce each result to this single value
Return value
array Values from API call
Overrides UtilsInterface::wf_crm_apivalues
12 calls to Utils::wf_crm_apivalues()
- Utils::wf_crm_format_event in src/
Utils.php - Utils::wf_crm_get_campaign_activity_types in src/
Utils.php - Get activity types related to CiviCampaign
- Utils::wf_crm_get_civi_setting in src/
Utils.php - Utils::wf_crm_get_contact_types in src/
Utils.php - Get contact types and sub-types Unlike pretty much every other option list CiviCRM wants "name" instead of "id"
- Utils::wf_crm_get_events in src/
Utils.php - Get list of events.
File
- src/
Utils.php, line 776 - Webform CiviCRM module's common utility functions.
Class
Namespace
Drupal\webform_civicrmCode
function wf_crm_apivalues($entity, $operation, $params = [], $value = NULL) {
if (is_numeric($params)) {
$params = [
'id' => $params,
];
}
$params += [
'options' => [],
];
// Work around the api's default limit of 25
$params['options'] += [
'limit' => 0,
];
$ret = wf_crm_aval($this
->wf_civicrm_api($entity, $operation, $params), 'values', []);
if ($value) {
foreach ($ret as &$values) {
$values = wf_crm_aval($values, $value);
}
}
return $ret;
}