3 added info about the body field
source | link

i think the wrapper doesnt provide the type label, at least i havent found it. One way to find the label :

$info = entity_get_info($fields->type());
echo $info['label'];

To learn more about available fields, try $fields->getPropertyInfo().

The diference of the body field is in the fact it is formatted, so the "first" value() function returns the object which allows you to retreive other metadata about the field. The difference can be spotted in the result of the aforementioned getPropertyInfo. While a "plain text" field is set to a callback function "entity_metadata_field_property_get", which returns the value immiediately, the body will have something like "entity_metadata_field_verbatim_get" which returns the whole array of the field.

according to the docs, you can also use value() on the wrapper itself and that will allow you to see what there is (so print_r($fields->value()); or dpm() the same will help :)

i think the wrapper doesnt provide the type label, at least i havent found it. One way to find the label :

$info = entity_get_info($fields->type());
echo $info['label'];

To learn more about available fields, try $fields->getPropertyInfo().

according to the docs, you can also use value() on the wrapper itself and that will allow you to see what there is (so print_r($fields->value()); or dpm() the same will help :)

i think the wrapper doesnt provide the type label, at least i havent found it. One way to find the label :

$info = entity_get_info($fields->type());
echo $info['label'];

To learn more about available fields, try $fields->getPropertyInfo().

The diference of the body field is in the fact it is formatted, so the "first" value() function returns the object which allows you to retreive other metadata about the field. The difference can be spotted in the result of the aforementioned getPropertyInfo. While a "plain text" field is set to a callback function "entity_metadata_field_property_get", which returns the value immiediately, the body will have something like "entity_metadata_field_verbatim_get" which returns the whole array of the field.

according to the docs, you can also use value() on the wrapper itself and that will allow you to see what there is (so print_r($fields->value()); or dpm() the same will help :)

2 improved code to suit original
source | link

i think the wrapper doesnt provide the type label, at least i havent found it. You can use $fields->type and search in One way to find the array returned by entity_get_info();label :

$info = entity_get_info($fields->type());
echo $info['label'];

To learn more about available fields, try getPropertyInfo$fields->getPropertyInfo().

according to the docs, you can also use value() on the wrapper itself and that will allow you to see what there is (so print_r($fields->value()); or dpm() the same will help :)

i think the wrapper doesnt provide the type label, at least i havent found it. You can use $fields->type and search in the array returned by entity_get_info();

To learn about available fields, try getPropertyInfo().

according to the docs, you can also use value() on the wrapper itself and that will allow you to see what there is (so print_r($fields->value()); or dpm() the same will help :)

i think the wrapper doesnt provide the type label, at least i havent found it. One way to find the label :

$info = entity_get_info($fields->type());
echo $info['label'];

To learn more about available fields, try $fields->getPropertyInfo().

according to the docs, you can also use value() on the wrapper itself and that will allow you to see what there is (so print_r($fields->value()); or dpm() the same will help :)

1
source | link

i think the wrapper doesnt provide the type label, at least i havent found it. You can use $fields->type and search in the array returned by entity_get_info();

To learn about available fields, try getPropertyInfo().

according to the docs, you can also use value() on the wrapper itself and that will allow you to see what there is (so print_r($fields->value()); or dpm() the same will help :)