function entity_property_extract_innermost_type in Entity API 7
Extracts the innermost type for a type string like list<list<date>>.
Parameters
$type: The type to examine.
Return value
string For list types, the innermost type. The type itself otherwise.
2 calls to entity_property_extract_innermost_type()
- entity_views_field_definition in views/
entity.views.inc - Helper function for adding a Views field definition to data selection based Views tables.
- entity_views_handler_field_entity::init in views/
handlers/ entity_views_handler_field_entity.inc - Initialize the entity type with the field's entity type.
File
- includes/
entity.property.inc, line 374 - Provides API functions around hook_entity_property_info(). Also see entity.info.inc, which cares for providing entity property info for all core entity types.
Code
function entity_property_extract_innermost_type($type) {
while (strpos($type, 'list<') === 0 && $type[strlen($type) - 1] == '>') {
$type = substr($type, 5, -1);
}
return $type;
}