Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By jibran on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.2.x
Introduced in version:
8.2.4
Issue links:
Description:
Now, the entity query allows specifying entity type ID with the entity property just like context system.
Before
Drupal::entityQuery('node')
->condition('uid.entity.name', 'foobar', '=')
->execute();
After
Drupal::entityQuery('node')
->condition('uid.entity:user.name', 'foobar', '=')
->execute();
Note: Before code still works. This is just an extra feature for the multiple entity type reference fields i.e. dynamic_entity_reference.
Impacts:
Module developers