Recently, I was asked how to check if a Field exists when using Drupal’s entity_metadata_wrapper() function.
This function actually loads and returns a wrapper Object to underlying data. The class called directly is EntityMetadataWrapper — and it has within its object hierarchy EntityListWrapper, EntityStructureWrapper and EntityValueWrapper. When you call the entity_metadata_wrapper function, depending upon the object you reference, a correct class is returned to you to use. Learn More