0

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?

E.g.

<?php

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

}
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:

node_type_get_types()
or
node_type_get_names()

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

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.