function date_entity_metadata_field_getter in Date 7
Same name and namespace in other branches
- 7.3 date.module \date_entity_metadata_field_getter()
- 7.2 date.module \date_entity_metadata_field_getter()
Getter callback to return date values as datestamp in UTC from the field.
1 string reference to 'date_entity_metadata_field_getter'
- date_entity_metadata_property_info_alter in ./
date.module - Callback to alter the property info of date fields.
File
- ./
date.module, line 599
Code
function date_entity_metadata_field_getter($object, array $options, $name, $obj_type, &$context) {
$return = entity_metadata_field_verbatim_get($object, $options, $name, $obj_type, $context);
$items = $context['field']['cardinality'] == 1 ? array(
$return,
) : $return;
foreach ($items as $key => $item) {
$items[$key] = date_entity_metadata_struct_getter($item, $options, 'value', 'struct');
}
return $context['field']['cardinality'] == 1 ? $items[0] : $items;
}