Commit cbf95a3c authored by dealancer's avatar dealancer

added function to get primary field names

parent 71013398
......@@ -1030,6 +1030,9 @@ function crm_core_contact_entity_property_info_alter(&$info) {
);
}
/**
* Get CRM Core Contact primary field name.
*/
function crm_core_contact_get_primary_field_name(CRMCoreContactEntity $contact, $primary_field) {
$contact_type = crm_core_contact_type_load($contact->type);
return empty($contact_type->primary_fields[$primary_field]) ? '' : $contact_type->primary_fields[$primary_field];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment