You are here

public function BatEventMetadataController::entityPropertyInfo in Booking and Availability Management Tools for Drupal 7

Overrides EntityDefaultMetadataController::entityPropertyInfo

File

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

Class

BatEventMetadataController
The MetadataController for BatEvent entities.

Code

public function entityPropertyInfo() {
  $info = parent::entityPropertyInfo();
  $properties = array(
    'event_id',
    'type',
    'language',
    'created',
    'changed',
    'uid',
  );
  foreach ($properties as $property) {
    if (isset($info['bat_event']['properties'][$property])) {
      $info['bat_event']['properties'][$property]['getter callback'] = 'entity_property_verbatim_get';
      $info['bat_event']['properties'][$property]['setter callback'] = 'entity_property_verbatim_set';
    }
  }
  $info['bat_event']['properties']['start_date'] = array(
    'label' => t('Start Date'),
    'description' => t('The start date for the event.'),
    'type' => 'date',
    'getter callback' => 'entity_property_verbatim_get',
    'setter callback' => 'bat_event_date_property_verbatim_set',
    'schema field' => 'start_date',
  );
  $info['bat_event']['properties']['end_date'] = array(
    'label' => t('End Date'),
    'description' => t('The end date for the event.'),
    'type' => 'date',
    'getter callback' => 'entity_property_verbatim_get',
    'setter callback' => 'bat_event_date_property_verbatim_set',
    'schema field' => 'end_date',
  );
  return $info;
}