You are here

function crm_core_contact_type_new in CRM Core 7

Return a new contact type with initialize fields.

Parameters

string $type: The machine-readable name of the contact type. Example: individual

Return value

A stdClass object with contact type fields

2 calls to crm_core_contact_type_new()
CRMCoreContactTestCase::testCRUD in modules/crm_core_contact/tests/crm_core_contact.test
crm_core_contact_install in modules/crm_core_contact/crm_core_contact.install
Implements hook_install().

File

modules/crm_core_contact/crm_core_contact.module, line 682
Provides default CRM Core Contact entities and the ability to create more.

Code

function crm_core_contact_type_new($type = '') {
  $values = array(
    'type' => $type,
    'locked' => 1,
  );
  return entity_create('crm_core_contact_type', $values);
}