You are here

function civicrm_entity_contact_assign_rel_contact_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_contact_field/civicrm_entity_contact_assign_rel_contact_field.module, line 296
Provide CiviCRM Entity Contact Assign Relationship Contacts List Field Type. Provides a widget for adding/removing a contacts relationships to a list of contacts.

Code

function civicrm_entity_contact_assign_rel_contact_field_field_insert($entity_type, $entity, $field, $instance, $langcode, &$items) {
  if ($entity_type == 'civicrm_contact') {
    if (!empty($items[0]['contacts'])) {
      if (!empty($entity->id)) {
        $contact_a_id = $entity->id;
        _civicrm_entity_contact_assign_rel_contact_field_process_field_items($contact_a_id, $field, $items);
      }
    }
  }
}