How to get an array of values of node ids from entity reference field with EntityMetadataWrappers I'm using a EntityMetadataWrapper on a profile2 entity. One of the fields is a multi-value entity reference field to nodes.  I want to simple get the node ids as an array, so I can do a quick in_array() to see if a value already exists.

I can't seem to find how to easily do this.
Should be as simple as:

$ids = $wrapper-&gt;field_foo-&gt;raw();


And if you want an array of entities instead:

$entities = $wrapper-&gt;field_foo-&gt;value();