public function BatType::getEventDefaultValue in Booking and Availability Management Tools for Drupal 7
Parameters
string $event_type:
Return value
mixed
File
- modules/
bat_unit/ bat_unit.module, line 1934
Class
- BatType
- The class used for Bat Type entities.
Code
public function getEventDefaultValue($event_type) {
if ($field = $this
->getEventValueDefaultField($event_type)) {
$field_info = field_info_field($field);
$values = field_get_items('bat_type', $this, $field);
if (!empty($values)) {
if ($field_info['type'] == 'bat_event_state_reference') {
return $values[0]['state_id'];
}
elseif ($field_info['type'] == 'commerce_price') {
return $values[0]['amount'];
}
elseif ($field_info['type'] == 'text' || $field_info['type'] == 'number_integer') {
return $values[0]['value'];
}
}
else {
return FALSE;
}
}
}