function bat_options_data_property_info in Booking and Availability Management Tools for Drupal 7
Defines info for the properties of the bat_options data structure.
1 call to bat_options_data_property_info()
- bat_options_property_info_callback in modules/
bat_options/ bat_options.module - Property callback for the Entity Metadata framework.
File
- modules/
bat_options/ bat_options.module, line 77
Code
function bat_options_data_property_info($name = NULL) {
// Build an array of basic property information for bat_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 bat_options properties.
foreach ($properties as &$value) {
$value += array(
'description' => !empty($name) ? t('!label of field %name', array(
'!label' => $value['label'],
'%name' => $name,
)) : '',
);
}
return $properties;
}