You are here

class BatEventMetadataController in Booking and Availability Management Tools for Drupal 7

The MetadataController for BatEvent entities.

Hierarchy

Expanded class hierarchy of BatEventMetadataController

1 string reference to 'BatEventMetadataController'
bat_event_entity_info in modules/bat_event/bat_event.module
Implements hook_entity_info().

File

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

View source
class BatEventMetadataController extends EntityDefaultMetadataController {
  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;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BatEventMetadataController::entityPropertyInfo public function Overrides EntityDefaultMetadataController::entityPropertyInfo
EntityDefaultMetadataController::$type protected property
EntityDefaultMetadataController::bundleOptionsList public static function A options list callback returning all bundles for an entity type.
EntityDefaultMetadataController::convertSchema protected function Return a set of properties for an entity based on the schema definition
EntityDefaultMetadataController::__construct public function