You are here

function _crm_core_contact_resource_create in CRM Core 7

Callback for the 'create' method.

1 call to _crm_core_contact_resource_create()
_crm_core_contact_resource_update in modules/crm_core_contact/includes/crm_core_contact_resource.inc
Callback for the 'update' method.
1 string reference to '_crm_core_contact_resource_create'
crm_core_contact_services_resources in modules/crm_core_contact/crm_core_contact.module
Implements hook_services_resources().

File

modules/crm_core_contact/includes/crm_core_contact_resource.inc, line 66
Resource definitions for services module.

Code

function _crm_core_contact_resource_create($contact_data) {
  try {
    $contact = entity_create('crm_core_contact', $contact_data);
    unset($contact->is_new);
    crm_core_contact_save($contact);
    return $contact;
  } catch (Exception $exception) {
    watchdog_exception('crm_core_contact', $exception);
    return services_error($exception, 406, $contact_data);
  }
}