better home computed reference field
This commit is contained in:
parent
68a7084deb
commit
7ce31674ea
|
@ -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();
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue