<?php
$involved_users = array();
//grab usernames from user reference field of a node
$project = entity_metadata_wrapper('node', $node);
// field_users is user reference field
foreach ($project->field_users as $acc) {
$involved_users[] = $acc->value()->name;
}
var_dump($involved_users);
?>
嗨,大家好,
我从http://pixeljets.com/blog/writing-robust-code-uses-fields-drupal-7
获得了这段代码我一直在经历它,但我似乎无法弄清楚“$ acc-&gt; value() - &gt; name;”工作?
什么是价值()?是PHP方法还是Drupal方法。我找不到任何关于此的文件。
谢谢!