You are here

function merci_reservation_entity_info in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.3

Implements hook_entity_info().

File

merci_reservation/merci_reservation.module, line 114

Code

function merci_reservation_entity_info() {
  $entities['merci_reservation'] = array(
    'label' => t('Merci reservation'),
    'plural label' => t('Merci reservations'),
    'base table' => 'merci_reservation',
    'fieldable' => TRUE,
    'entity class' => 'MerciReservation',
    'controller class' => 'MerciReservationController',
    'access callback' => 'merci_reservation_access',
    'label callback' => 'entity_class_label',
    'uri callback' => 'entity_class_uri',
    'module' => 'merci_reservation',
    'load hook' => 'merci_reservation_load',
    'entity keys' => array(
      'id' => 'id',
      'bundle' => 'type',
    ),
    'bundle keys' => array(
      'bundle' => 'type',
    ),
    'admin ui' => array(
      'path' => 'merci_reservation',
      'file' => 'merci_reservation.pages.inc',
      'controller class' => 'ReservationUIController',
    ),
    'bundles' => array(),
    'view modes' => array(
      'display' => array(
        'label' => t('Display'),
        'custom settings' => FALSE,
      ),
    ),
  );

  // The entity that holds information about the entity types
  $entities['merci_reservation_type'] = array(
    'label' => t('Merci Reservation Type'),
    'entity class' => 'MerciReservationType',
    'controller class' => 'MerciReservationTypeController',
    'base table' => 'merci_reservation_type',
    'fieldable' => FALSE,
    'bundle of' => 'merci_reservation',
    'exportable' => TRUE,
    'entity keys' => array(
      'id' => 'id',
      'name' => 'type',
      'label' => 'label',
    ),
    'access callback' => 'merci_reservation_type_access',
    'module' => 'merci_reservation',
    // Enable the entity API's admin UI.
    'admin ui' => array(
      'path' => 'admin/merci/merci-reservation-types',
      'file' => 'merci_reservation.admin.inc',
      'controller class' => 'ReservationTypeUIController',
      'menu_wildcard' => '%merci_reservation_type',
    ),
  );
  return $entities;
}