You are here

function rooms_options_data_property_info in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7

Defines info for the properties of the rooms_options data structure.

1 call to rooms_options_data_property_info()
rooms_options_property_info_callback in ./rooms.module
Property callback for the Entity Metadata framework.

File

./rooms.module, line 565
Provides basic underlying functionality and configuration options used by all Rooms modules

Code

function rooms_options_data_property_info($name = NULL) {

  // Build an array of basic property information for rooms_options.
  $properties = array(
    'name' => array(
      'label' => 'Name',
      'type' => 'text',
      'getter callback' => 'entity_property_verbatim_get',
      'setter callback' => 'entity_property_verbatim_set',
    ),
    'quantity' => array(
      'label' => 'Quantity',
      'type' => 'integer',
      'getter callback' => 'entity_property_verbatim_get',
      'setter callback' => 'entity_property_verbatim_set',
    ),
    'operation' => array(
      'label' => 'Operation',
      'type' => 'text',
      'getter callback' => 'entity_property_verbatim_get',
      'setter callback' => 'entity_property_verbatim_set',
    ),
    'value' => array(
      'label' => 'Value',
      'type' => 'integer',
      'getter callback' => 'entity_property_verbatim_get',
      'setter callback' => 'entity_property_verbatim_set',
    ),
    'type' => array(
      'label' => 'Type',
      'type' => 'text',
      'getter callback' => 'entity_property_verbatim_get',
      'setter callback' => 'entity_property_verbatim_set',
    ),
  );

  // Add the default values for each of the rooms_options properties.
  foreach ($properties as &$value) {
    $value += array(
      'description' => !empty($name) ? t('!label of field %name', array(
        '!label' => $value['label'],
        '%name' => $name,
      )) : '',
    );
  }
  return $properties;
}