What's the best way to use Entity Field Query to search multiple fields? I have a content type called "Projects" that has custom fields for "Project Manager" and "Developer, which are references to users, and I am trying to display a list of projects a given user is associated with on each user's profile.
This is what I have so far:
<?php
// Print all projects associated with this user
$profile = user_load(arg(1));
// Check database for reference to this user in pm field
$query = new EntityFieldQuery();
$result = $query->entityCondition('entity_type', 'node')
->entityCondition('bundle', 'project')
->propertyCondition('status', 1)
->fieldCondition('<insert multiple fields here..?>', 'target_id', $profile->uid, '=')
->execute();
if (!empty($result['node'])) {
$nids = array_keys($result['node']);
$nodes = node_load_multiple(array_keys($result['node']));
echo "<b>User's projects:<br></b>";
}
// display projects
foreach ($nodes as &$node) {
$targetPath = "content/";
$targetPath .= str_replace(' ', '-', $node->title);
$targetPath = 'http://'.$_SERVER['HTTP_HOST'].base_path().drupal_get_path_alias($targetPath, $path_language = '');
echo "<a href='$targetPath'>$node->title</a><br>";
}
?>