How do I access the updated entity after saving with entity wrapper When using entity wrapper to modify and save an entity, what is the preferred way of accessing the updated entity.

For example, after the following code saves the node:

$node = node_load(123);
$node_wrapper = entity_metadata_wrapper('node', $node);
$node_wrapper-&gt;field_textfield-&gt;set('New value');
$node_wrapper-&gt;save();


After that, what is the preferred way to access the updated node object (the full object, not just field values)?
Can it be accessed via the wrapper in some way or do you have to load the node again?
There's no "preferred" way, as such, but I guess if you're using the wrapper to work with the entity, it makes sense to stick with that convention to re-access it.

Don't forget you've just altered an in-memory object, so regardless of the persistence layer, that object will still have the changes in it.

Once you've done this:

$node_wrapper-&gt;field_textfield-&gt;set('New value');
$node_wrapper-&gt;save();


Your changes will immediately be available by inspecting

$node_wrapper-&gt;field_textfield


EMWs use the core entity API under the hood, so persistence is actually done through the default entity controller. As such, everything that would happen in calling node_save(), for example, happens when you update the wrapper object.

In practical terms, that means you can save an entity with EMW, and also access the changes on it immediately using an object returned from entity_load(). It's the same underlying object in memory.

I think it's safe to say that context, and even surrounding code/conventions, will often dictate the particular method you use.