Skip to content

Instantly share code, notes, and snippets.

@batandwa
Created August 19, 2014 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save batandwa/70b5cda00fda2bbcd3c6 to your computer and use it in GitHub Desktop.
Save batandwa/70b5cda00fda2bbcd3c6 to your computer and use it in GitHub Desktop.
Drupal 7 Entities - Fetch entities using EntityFieldQuery.
<?php
$entity_type = "node";
$bundle = "my_custon_content_type";
$query = new EntityFieldQuery();
$query
->entityCondition('entity_type', $entity_type)
->entityCondition('bundle', $bundle)
->fieldCondition('field_dwnl_file_content', 'value', 9);
$result = $query->execute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment