how to add mutilple entity_type and bundles in EntityFieldQuery?

$query->entityCondition('entity_type', 'profile2') ->entityCondition('bundle', 'user_profile');

Is there any way to do like this

$query->entityCondition('entity_type', array('profile2','user')) ->entityCondition('bundle', array('user_profile','property'));

  • can you pls tell me how to add multiple entity_type. – Mukilan R Sep 5 '14 at 8:27

This should work:

$query->entityCondition('entity_type', array('profile2','user'))
      ->entityCondition('bundle', array('user_profile','property'), 'IN');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.