better home computed reference field

This commit is contained in:
Bachir Soussi Chiadmi 2019-07-16 10:40:12 +02:00
parent 68a7084deb
commit 7ce31674ea
2 changed files with 3 additions and 0 deletions

View File

@ -38,6 +38,7 @@ class ComputedArticlesReferences extends EntityReferenceFieldItemList
$query = \Drupal::entityQuery('node') $query = \Drupal::entityQuery('node')
->condition('status', 1) ->condition('status', 1)
->sort('created', 'DESC') ->sort('created', 'DESC')
->exists('field_visuel')
->range(0,6) ->range(0,6)
->condition('type', 'article'); ->condition('type', 'article');
$nids = $query->execute(); $nids = $query->execute();

View File

@ -40,6 +40,8 @@ class ComputedMaterialsReferences extends EntityReferenceFieldItemList
$query = \Drupal::entityQuery('node') $query = \Drupal::entityQuery('node')
->condition('status', 1) ->condition('status', 1)
->condition('type', 'materiau') ->condition('type', 'materiau')
->exists('field_materiau_images')
->condition('field_materiau_images.%delta', 3)
->sort('created', 'DESC') ->sort('created', 'DESC')
->range(0,200); ->range(0,200);
$results = $query->execute(); $results = $query->execute();