You are here

function _civicrm_entity_option_lookup in CiviCRM Entity 7.2

Returns a comma delimited list of option labels from id values

Parameters

$field:

$values:

Return value

string

Throws

CiviCRM_API3_Exception

1 call to _civicrm_entity_option_lookup()
_civicrm_entity_render_fields in ./civicrm_entity.ds.inc
Default Display Suite Render handler for CiviCRM "fields".

File

./civicrm_entity.ds.inc, line 211

Code

function _civicrm_entity_option_lookup($field, $values) {
  $result = civicrm_api3(substr($field['entity_type'], 8), 'getoptions', array(
    'field' => $field['field_name'],
  ));
  $fm = array();
  foreach ($values as $value) {
    $fm[] = $result['values'][$value];
  }
  return implode(",", $fm);
}