Skip to content

Instantly share code, notes, and snippets.

@jamesmorrish
Created September 23, 2013 10:56
Show Gist options
  • Save jamesmorrish/6668996 to your computer and use it in GitHub Desktop.
Save jamesmorrish/6668996 to your computer and use it in GitHub Desktop.
Example entity field query including language.
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node')
->propertyCondition('type', 'blog')
->propertyCondition('status', 1)
->propertyOrderBy('created', 'DESC')
->fieldCondition('field_journal_carousel_image', 'fid', 0, '!=')
->range(0, 10);
$query->propertyCondition('language', array($GLOBALS['language']->language, LANGUAGE_NONE), 'IN');
$result = $node_query->execute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment