[support] Entity_metadata_wrapper: Does field have data?

Nancy Wichmann nan_wich at bellsouth.net
Mon Aug 12 17:25:48 UTC 2013


With fields I often do:
  if ($vca = field_get_items('node', $node, 'field_corresponding_vca')) {


This makes sure there is some data before trying to do anything with it.

But I've searched all over the place and even dug into the code. How do you do this with entity_metadata_wrapper? I want to give the users an error message that means something to them, and sometimes just set the value to zero.

I see that the Entity module has a protected function called "dataAvailable" but I can't use a protected function.

 
Nancy 

Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20130812/9d6233e5/attachment.html 


More information about the support mailing list