Posted by dgtall on July 31, 2015 at 10:30pm
I need to programaticaly set a value for a custom entity on a nodes entity reference field. I am trying to determine if all I need to do is just save the entity id or load the entity and use a metadata wrappper to set the value.
Comments
You only need to set the
You only need to set the target_id. I.e.
$node->entity_reference_field['und'][0]['target_id'] = $entity_id;