3

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'));

1
  • can you pls tell me how to add multiple entity_type.
    – Mukilan R
    Commented Sep 5, 2014 at 8:27

1 Answer 1

6

This should work:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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