function _fivestar_update_field_value in Fivestar 7.2
Helper function to store a rating into the field storage.
1 call to _fivestar_update_field_value()
- fivestar_ajax_submit in ./
fivestar.module - AJAX submit handler for fivestar_custom_widget.
File
- includes/
fivestar.field.inc, line 208 - Provides CCK integration for fivestar module.
Code
function _fivestar_update_field_value($entity_type, $entity, $field_name, $langcode, $value) {
$entity->{$field_name}[$langcode][0]['rating'] = $value;
$entity->original = isset($entity->original) ? $entity->original : NULL;
field_attach_presave($entity_type, $entity);
field_attach_update($entity_type, $entity);
}