Skip to content

Instantly share code, notes, and snippets.

@Kloport
Last active October 22, 2017 18:09
Show Gist options
  • Save Kloport/bc6691f799875002fe965783306c06b9 to your computer and use it in GitHub Desktop.
Save Kloport/bc6691f799875002fe965783306c06b9 to your computer and use it in GitHub Desktop.
$query = \Drupal::entityQuery('node')
->condition('status', 1) // published
->condition('type', 'article')
->condition('langcode', $langcode)
->range(0, 10)
->sort('created', 'DESC');
$nids = $query->execute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment