You are here

function bat_event_entity_info_alter in Booking and Availability Management Tools for Drupal 7

Implements hook_entity_info_alter().

We are adding the info about the event types via a hook to avoid a recursion issue as loading the event types requires the entity info as well.

File

modules/bat_event/bat_event.module, line 137
Manage Events - Events store the EventValue of a Unit over a period of time.

Code

function bat_event_entity_info_alter(&$entity_info) {
  foreach (bat_event_get_types() as $type => $info) {
    $entity_info['bat_event']['bundles'][$type] = array(
      'label' => $info->label,
      'admin' => array(
        'path' => 'admin/bat/events/event-types/manage/%bat_event_type',
        'real path' => 'admin/bat/events/event-types/manage/' . $type,
        'bundle argument' => 5,
        'access arguments' => array(
          'administer bat_event_type entities',
        ),
      ),
    );
  }
}