Skip to content

Instantly share code, notes, and snippets.

@seanbuscay
Created September 21, 2016 19:47
Show Gist options
  • Save seanbuscay/b932ec904ad890f9f706326c7dd219c5 to your computer and use it in GitHub Desktop.
Save seanbuscay/b932ec904ad890f9f706326c7dd219c5 to your computer and use it in GitHub Desktop.

Revisions

  1. Sean Buscay created this gist Sep 21, 2016.
    7 changes: 7 additions & 0 deletions new_gist_file_0
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    $query = new EntityFieldQuery();
    $query->entityCondition('entity_type', 'node')
    ->propertyCondition('status', 1)
    ->propertyCondition('type', array('article', 'page', 'blog'))
    ->propertyOrderBy('created', 'DESC')
    ->range(0, 5);
    $result = $query->execute();