2 gave an update to my question
source | link

I'm struggling to determine which entity_metadata_wrapper methods are available for a given field. For instance:

<?php
  $fields = entity_metadata_wrapper('node', $nid);
  $body = $fields->body->value->value();
  $title = $fields->title->value();
  $type = $fields->type->value();
?>

$body has a different method, where you have to do a ->value->value() for it to work right.

In my situation I'm trying to get the type of the node in Human readable form: "Custom Type" vs. "custom_type". I'm wondering if there is some kind of value() method that returns the human readable version. print_r($fields) avails me not.

Edit: To get the Human readable node type I ended up just using node_type_load. It seems like there should be a more efficient way of doing this using the Entity API, but I can't figure it out.

I'm struggling to determine which entity_metadata_wrapper methods are available for a given field. For instance:

<?php
  $fields = entity_metadata_wrapper('node', $nid);
  $body = $fields->body->value->value();
  $title = $fields->title->value();
  $type = $fields->type->value();
?>

$body has a different method, where you have to do a ->value->value() for it to work right.

In my situation I'm trying to get the type of the node in Human readable form: "Custom Type" vs. "custom_type". I'm wondering if there is some kind of value() method that returns the human readable version. print_r($fields) avails me not.

I'm struggling to determine which entity_metadata_wrapper methods are available for a given field. For instance:

<?php
  $fields = entity_metadata_wrapper('node', $nid);
  $body = $fields->body->value->value();
  $title = $fields->title->value();
  $type = $fields->type->value();
?>

$body has a different method, where you have to do a ->value->value() for it to work right.

In my situation I'm trying to get the type of the node in Human readable form: "Custom Type" vs. "custom_type". I'm wondering if there is some kind of value() method that returns the human readable version. print_r($fields) avails me not.

Edit: To get the Human readable node type I ended up just using node_type_load. It seems like there should be a more efficient way of doing this using the Entity API, but I can't figure it out.

1
source | link

Determine available Entities entity_metadata_wrapper value() methods

I'm struggling to determine which entity_metadata_wrapper methods are available for a given field. For instance:

<?php
  $fields = entity_metadata_wrapper('node', $nid);
  $body = $fields->body->value->value();
  $title = $fields->title->value();
  $type = $fields->type->value();
?>

$body has a different method, where you have to do a ->value->value() for it to work right.

In my situation I'm trying to get the type of the node in Human readable form: "Custom Type" vs. "custom_type". I'm wondering if there is some kind of value() method that returns the human readable version. print_r($fields) avails me not.