Trying to use entity field query to simplify some times; e.g. a slide show of images.

How does one get the field values for entity field query. Specifically, get a list of all the possible bundle types there are?



function foo_load() {
   $query = new EntityFieldQuery;
     // What conditions or properties are there?
     ->entityCondition('entity_type', 'node')
     ->entityCondition('bundle', 'banner')
     ->propertyOrderBy('created', 'DESC');
     ->propertyCondition('status', 1);


If as per your example code you are just concerned with nodes then the bundles are just your node types.

If you want to get a list of node types you can use:


You can get the bundles from the array keys of the arrays returned from those functions.

| improve this answer | |

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.