You are here

function _civicrm_entity_labels in CiviCRM Entity 7

Same name and namespace in other branches
  1. 7.2 civicrm_entity.module \_civicrm_entity_labels()

Provide label (column) for each entity types.

@TODO Use the CiviCRM 4.5 getlist function - possibly ported into this module to support 4.4

Parameters

$entity:

See also

http://api.drupal.org/api/drupal/modules!system!system.api.php/function/...

2 calls to _civicrm_entity_labels()
civicrm_entity_entity_info in ./civicrm_entity.module
Here we declare selected CiviCRM entities to Drupal.
_civicrm_entity_get_title in ./civicrm_entity.module

File

./civicrm_entity.module, line 338
Implement CiviCRM entities as a Drupal Entity.

Code

function _civicrm_entity_labels($entity) {
  $labels = array(
    'civicrm_activity' => 'subject',
    'civicrm_address' => 'address_name',
    'civicrm_contact' => 'display_name',
    'civicrm_contribution' => 'source',
    'civicrm_event' => 'title',
    'civicrm_participant' => 'source',
    'civicrm_relationship' => 'description',
    'civicrm_relationship_type' => 'description',
    // OK, I'm just putting in something that won't error for now.
    'civicrm_entity_tag' => 'tag_id',
    'civicrm_financial_type' => 'description',
    // Ditto.
    'civicrm_membership' => 'id',
    'civicrm_membership_type' => 'name',
    'civicrm_group' => 'name',
    'civicrm_grant' => 'id',
    'civicrm_tag' => 'name',
  );
  return $labels[$entity];
}