Skip to content

Instantly share code, notes, and snippets.

@heyMP
Created November 27, 2013 18:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heyMP/7681100 to your computer and use it in GitHub Desktop.
Save heyMP/7681100 to your computer and use it in GitHub Desktop.
Using Entity Wrapper to easily save yo entities.
function _update_multi_registration($flag, $entity_id, $status) {
$entity_type = $flag->entity_type;
$entity = entity_load_single($entity_type, $entity_id);
$nodewrapper = entity_metadata_wrapper($entity_type, $entity);
$nodewrapper->field_event_mult_reg = $status;
$nodewrapper->save(true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment