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->entityCondition('entity_type', 'entityform')
->addTag('or')
->execute();
/** Implements hook_query_TAG_alter
@param QueryAlterableInterface $query */
function mymodule_query_or_alter(QueryAlterableInterface $query) {
$or = db_or()->condition('field_a',$term->tid)
->condition('field_B', $term->tid);
->condition($or)
->execute();
Fatal error: Call to undefined method DatabaseCondition::execute()
fieldCondition
and other EFQ-specific methods. You'll need to use the usualcondition
method