function bat_event_date_property_verbatim_set in Booking and Availability Management Tools for Drupal 7
Convert timestamp to string.
1 string reference to 'bat_event_date_property_verbatim_set'
- BatEventMetadataController::entityPropertyInfo in modules/
bat_event/ bat_event.module
File
- modules/
bat_event/ bat_event.module, line 1274 - Manage Events - Events store the EventValue of a Unit over a period of time.
Code
function bat_event_date_property_verbatim_set(&$data, $name, $value, $langcode, $type, $info) {
$date = new DateTime();
$date
->setTimestamp($value);
$name = isset($info['schema field']) ? $info['schema field'] : $name;
if (is_array($data) || is_object($data) && $data instanceof ArrayAccess) {
$data[$name] = $date
->format('Y-m-d H:i:s');
}
elseif (is_object($data)) {
$data->{$name} = $date
->format('Y-m-d H:i:s');
}
}