You are here

function _civicrm_entity_contact_assign_rel_type_list_field_get_field_settings_relationship_types in CiviCRM Entity 7.2

Helper function to get an array of Relationship Type descriptions keyed by relationship type id

Parameters

$field:

Return value

array

2 calls to _civicrm_entity_contact_assign_rel_type_list_field_get_field_settings_relationship_types()
civicrm_entity_contact_assign_rel_type_list_field_field_widget_form in modules/civicrm_entity_contact_assign_rel_type_list_field/civicrm_entity_contact_assign_rel_type_list_field.module
Implements hook_field_widget_form().
_civicrm_entity_contact_assign_rel_type_list_field_process_field_items in modules/civicrm_entity_contact_assign_rel_type_list_field/civicrm_entity_contact_assign_rel_type_list_field.module
Helper function to process field items on entity insert or update

File

modules/civicrm_entity_contact_assign_rel_type_list_field/civicrm_entity_contact_assign_rel_type_list_field.module, line 486
Provide CiviCRM Entity Contact Assign Relationship Type List Field Type. Provides a widget for adding/removing a contacts relationships to a configured global contact.

Code

function _civicrm_entity_contact_assign_rel_type_list_field_get_field_settings_relationship_types($field) {
  civicrm_initialize();
  $relationship_types = array();
  foreach ($field['settings']['relationship_types'] as $id => $rtid) {
    try {
      $result = civicrm_api3('RelationshipType', 'getvalue', array(
        'return' => "description",
        'id' => $rtid,
      ));
      $relationship_types[$id] = $result;
    } catch (CiviCRM_API3_Exception $e) {
      continue;
    }
  }
  return $relationship_types;
}