You are here

function civicrm_entity_contact_assign_rel_type_list_field_field_insert in CiviCRM Entity 7.2

Implements hook_field_insert().

Parameters

$entity_type:

$entity:

$field:

$instance:

$langcode:

$items:

File

modules/civicrm_entity_contact_assign_rel_type_list_field/civicrm_entity_contact_assign_rel_type_list_field.module, line 172
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_field_insert($entity_type, $entity, $field, $instance, $langcode, &$items) {
  if ($entity_type == 'civicrm_contact') {
    if (!empty($items[0]['relationship_types'])) {
      if (!empty($entity->id)) {
        $contact_a_id = $entity->id;
        _civicrm_entity_contact_assign_rel_type_list_field_process_field_items($contact_a_id, $field, $items);
      }
    }
  }
}