function entity_property_verbatim_get in Entity API 7
Gets the property just as it is set in the data.
1 call to entity_property_verbatim_get()
- entity_metadata_verbatim_get in includes/
entity.property.inc - Deprecated. Do not make use of this function, instead use the new one.
3 string references to 'entity_property_verbatim_get'
- entity_metadata_taxonomy_entity_property_info in modules/
taxonomy.info.inc - Implements hook_entity_property_info() on top of taxonomy module.
- entity_property_info_defaults in includes/
entity.property.inc - Returns the default information for an entity property.
- entity_property_text_formatted_info in includes/
entity.property.inc - Defines info for the properties of the text_formatted data structure.
File
- includes/
entity.property.inc, line 384 - 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_verbatim_get($data, array $options, $name, $type, $info) {
$name = isset($info['schema field']) ? $info['schema field'] : $name;
if ((is_array($data) || is_object($data) && $data instanceof ArrayAccess) && isset($data[$name])) {
return $data[$name];
}
elseif (is_object($data) && isset($data->{$name})) {
// Incorporate i18n_string translations. We may rely on the entity class
// here as its usage is required by the i18n integration.
if (isset($options['language']) && !empty($info['i18n string'])) {
return $data
->getTranslation($name, $options['language']->language);
}
else {
return $data->{$name};
}
}
return NULL;
}