You are here

function crm_core_contact_entity_info_alter in CRM Core 7

Implements hook_entity_info_alter().

Use this hook to specify contact bundles to avoid a recursion, as loading the contact types needs the entity info too.

File

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

Code

function crm_core_contact_entity_info_alter(&$entity_info) {
  foreach (crm_core_contact_type_get_name() as $type => $name) {
    $entity_info['crm_core_contact']['bundles'][$type] = array(
      'label' => $name,
      'admin' => array(
        'path' => 'admin/structure/crm-core/contact-types/manage/%crm_core_contact_type',
        'real path' => 'admin/structure/crm-core/contact-types/manage/' . $type,
        'bundle argument' => 5,
        'access arguments' => array(
          'administer contact types',
        ),
      ),
    );
  }
}