You are here

function group_entity_info_alter in Group 7

Implements hook_entity_info_alter().

File

./group.entity.inc, line 177
Contains all Entity API functions for the Group module.

Code

function group_entity_info_alter(&$entity_info) {

  // Informs Drupal that group types are bundles for groups.
  foreach (group_types() as $name => $group_type) {
    $entity_info['group']['bundles'][$name] = array(
      'label' => $group_type->label,
      'admin' => array(
        'path' => 'admin/group/type/manage/%group_type',
        'real path' => 'admin/group/type/manage/' . $name,
        'bundle argument' => 4,
        'access arguments' => array(
          'configure group module',
        ),
      ),
    );
  }

  // Entities default to not being group entities.
  foreach ($entity_info as $entity => $data) {
    $entity_info[$entity] += array(
      'group entity' => FALSE,
    );
  }
}