Conditional clauses with Entity field Query I have a syntax issue on using conditional clauses with EFQ, but the documentation on drupal.org is a bit unclear for me. I have google the whole Internet for this with no results at all. My hook implementation is based on another drupal.stackexchange question

The code works for a single ->fieldCondition but when I try to implement the hook below,

    $query = new EntityFieldQuery();
    $entityFormSubmissionIds = $query-&gt;entityCondition('entity_type', 'entityform')
      -&gt;addTag('or')
      -&gt;execute();



  /**
  Implements hook_query_TAG_alter
  
  @param QueryAlterableInterface $query
  */


function mymodule_query_or_alter(QueryAlterableInterface $query) {
 $or = db_or()-&gt;condition('field_a',$term-&gt;tid)
       -&gt;condition('field_B', $term-&gt;tid);
    -&gt;condition($or)
    -&gt;execute();


Fatal error: Call to undefined method DatabaseCondition::execute()
In the alter hook, you should not be calling execute(). You don't want to run the query at this point, just change it.

function mymodule_query_or_alter(QueryAlterableInterface $query) {
 $or = db_or()-&gt;condition('field_a',$term-&gt;tid)
       -&gt;condition('field_B', $term-&gt;tid);
 $query-&gt;condition($or)
}