You are here

function _civicrm_entity_participant_get_formatted_values in CiviCRM Entity 7.2

Participant entity field formatted value special handling

Parameters

$field:

$wrapper:

$entity:

Return value

mixed

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

File

./civicrm_entity.ds.inc, line 247

Code

function _civicrm_entity_participant_get_formatted_values(&$field, $wrapper, $entity) {
  switch ($field['field_name']) {
    case 'role_id':
    case 'status_id':
    case 'register_date':
    case 'source':
    case 'fee_currency':
    case 'is_pay_later':
    case 'registered_by_id':
    case 'fee_amount':
    case 'is_test':
      return $entity->{'participant_' . $field['field_name']};
    case 'fee_level':
      return $entity->{'participant_' . $field['field_name']}[0];
    default:
      return $wrapper->{$field['field_name']}
        ->value();
  }
}