By jibran on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x-1.x, 8.x-2.x
Introduced in version:
8.x-1.2, 8.x-2.0-ALPHA1
Description:
After Entity query allows to specify entity type ID for reference fields, Dynamic Entity Reference supports entity field query.
For example, with dynamic entity reference field der_field on node which can reference users and taxonomy terms.
To find all the nodes referencing user foo.
Drupal::entityQuery('node')
->condition('der_field.entity:user.name', 'foo', '=')
->execute();
To find all the nodes referencing taxonomy term bar.
Drupal::entityQuery('node')
->condition('der_field.entity:taxonomy_term.name', 'bar', '=')
->execute();
Impacts:
Module developers