EntityFieldQuery INNER JOIN I'd like to run a query using the EntityFieldQuery object. I need value from both the node and node_access table therefore I'd need to use INNER JOIN. From the d.o documentation I can't figure out how this is possible.

Here's what I have --

$query = new EntityFieldQuery();
$result = $query-&gt;entityCondition('entity_type', 'node')
-&gt;entityCondition('bundle', 'node_access')
-&gt;propertyCondition('type', 'external_link')
-&gt;propertyCondition('status', 1)
-&gt;fieldCondition('gid', '3', '=')
-&gt;fieldCondition('realm', 'domain_id', '=')
-&gt;fieldCondition('grant_view', '1', '&gt;=')
-&gt;range(0,1)
-&gt;execute();
You can't add extra joins to an EntityFieldQuery directly (it's not supported), but you could add a tag to the query, implement hook_query_TAG_alter(), and add the join manually when the query is converted down to a standard db query.

This isn't tested but will probably get you most of the way there:

$query = new EntityFieldQuery;
$query-&gt;entityCondition('entity_type', 'node')
  -&gt;entityCondition('bundle', 'node_access')
  // etc
  -&gt;addTag('MYTAG');

// get the query results as normal


And then the query alter function:

function MYDMOULE_query_MYTAG_alter(QueryAlterableInterface $query) {
  $query-&gt;join('node_access', 'node_access', 'node_access.nid = node.nid');
}


The other way to do it would be to subclass EntityFieldQuery itself and add the join, but I think the above method is simpler in this case.