You are here

function crm_core_contact_entity_property_info in CRM Core 7

Implements hook_entity_property_info().

Add entity metadata properties for contact primary fields.

See also

entity_metadata_entity_property_info()

File

modules/crm_core_contact/crm_core_contact.module, line 129
Provides default CRM Core Contact entities and the ability to create more.

Code

function crm_core_contact_entity_property_info() {
  $info['crm_core_contact']['properties']['primary_email'] = array(
    'label' => t('Primary email'),
    'type' => 'text',
    'description' => t('Get primary e-mail of CRM Core Contact.'),
    'getter callback' => 'crm_core_contact_get_primary_email_field_value',
    'computed' => TRUE,
  );
  $info['crm_core_contact']['properties']['primary_address'] = array(
    'label' => t('Primary address'),
    'type' => 'struct',
    'description' => t('Get primary address of CRM Core Contact.'),
    'getter callback' => 'crm_core_contact_get_primary_address_field_value',
    'computed' => TRUE,
  );
  $info['crm_core_contact']['properties']['primary_phone'] = array(
    'label' => t('Primary phone'),
    'type' => 'struct',
    'description' => t('Get primary phone of CRM Core Contact.'),
    'getter callback' => 'crm_core_contact_get_primary_phone_field_value',
    'computed' => TRUE,
  );
  return $info;
}