You are here

function availability_calendar_entity_info in Availability Calendars 7.5

Implements hook_entity_info().

Defines the "internals" of this module's data model to Drupal core and Entity API (from contrib):

  • availability_calendar_calendar is defined as entity.
  • availability_calendar_availability cannot be defined as entity as it does not have a numeric primary key. Will be defined as property of a calendar though (in a future version).
  • availability_calendar_state could be defined as configuration entities, so it could be exported, but has not been defined as such yet.

Both Drupal core and Entity API keys and values are defined here.

File

./availability_calendar.entity.inc, line 38
Contains Entity API and Search API hooks and callbacks.

Code

function availability_calendar_entity_info() {
  $return = array(
    'availability_calendar_calendar' => array(
      'module' => 'availability_calendar',
      'label' => t('Availability Calendar'),
      'plural label' => t('Availability Calendars'),
      'description' => t('An entity type used to store date based availability.'),
      'base table' => 'availability_calendar_calendar',
      'revision table' => null,
      'entity keys' => array(
        'id' => 'cid',
      ),
      'fieldable' => FALSE,
      'view modes' => array(
        'full' => array(
          'label' => t('Full content'),
          'custom settings' => FALSE,
        ),
      ),
      'controller class' => 'EntityAPIController',
      'entity class' => 'Entity',
      'label callback' => 'entity_class_label',
      'uri callback' => 'entity_class_uri',
      'views controller class' => 'AvailabilityCalendarViewsController',
    ),
  );
  return $return;
}