function _civicrm_entity_contact_group_assign_field_remove_contact_from_group in CiviCRM Entity 7.2
Helper function, remove a contact from a group
Parameters
$contact_id:
$group_id:
1 call to _civicrm_entity_contact_group_assign_field_remove_contact_from_group()
- _civicrm_entity_contact_group_assign_field_process_field_items in modules/
civicrm_entity_contact_group_assign_field/ civicrm_entity_contact_group_assign_field.module - Helper function to process field items on entity insert or update
File
- modules/
civicrm_entity_contact_group_assign_field/ civicrm_entity_contact_group_assign_field.module, line 522 - Provide CiviCRM Entity Contact Group Assign Field Type. Provides a widget for adding/removing a contact to a selected list of groups.
Code
function _civicrm_entity_contact_group_assign_field_remove_contact_from_group($contact_id, $group_id) {
civicrm_initialize();
try {
$result = civicrm_api3('GroupContact', 'create', array(
'contact_id' => $contact_id,
'group_id' => $group_id,
'status' => 'Removed',
));
} catch (CiviCRM_API3_Exception $e) {
}
}