function entity_property_verbatim_set in Entity API 7
Sets the property to the given value. May be used as 'setter callback'.
1 call to entity_property_verbatim_set()
- entity_metadata_verbatim_set in includes/
entity.property.inc - Deprecated. Do not make use of this function, instead use the new one.
10 string references to 'entity_property_verbatim_set'
- entity_metadata_comment_entity_property_info in modules/
comment.info.inc - Implements hook_entity_property_info() on top of comment module.
- entity_metadata_comment_entity_property_info_alter in modules/
comment.info.inc - Implements hook_entity_property_info_alter() on top of comment module.
- entity_metadata_locale_entity_property_info_alter in modules/
locale.info.inc - Implements hook_entity_property_info_alter() on top of locale module.
- entity_metadata_node_entity_property_info in modules/
node.info.inc - Implements hook_entity_property_info() on top of node module.
- entity_metadata_taxonomy_entity_property_info in modules/
taxonomy.info.inc - Implements hook_entity_property_info() on top of taxonomy module.
File
- includes/
entity.property.inc, line 418 - 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_set(&$data, $name, $value, $langcode, $type, $info) {
$name = isset($info['schema field']) ? $info['schema field'] : $name;
if (is_array($data) || is_object($data) && $data instanceof ArrayAccess) {
$data[$name] = $value;
}
elseif (is_object($data)) {
$data->{$name} = $value;
}
}