[PP-1] Make it possible to capture cacheable metadata from underlying entity queries in EntityStorageInterface::loadByProperties()

Created on 30 June 2025, 1 day ago

Problem/Motivation

In Improve query and cache API so that render() doesn't have to be called to add query cache metadata Active , entity query classes were updated to implement RefinableCacheableDependencyInterface, so that any cacheable metadata needed in the logic to build the queries is accessible from the query object.

EntityStorage::loadByProperties() uses entity queries under the hood, so ideally code calling loadByProperties() should able to retrieve the cacheable metadata from the query. In addition, EntityRepository::loadEntityByUuid() calls EntityStorage::loadByProperties(), so the same should apply.

Steps to reproduce

Proposed resolution

Add an additional optional parameter EntityStorageInterface::loadByProperties() and EntityRepositoryInterface::loadEntityByUuid() for calling code to pass in an object (CacheableMetadata, probably?) that can capture the cacheable metadata from the underlying entity query.

There might also be a need to identify other Entity API methods that similarly wrap entity queries and see whether they need to provide a way to access the cache metadata as well.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Feature request
Status

Active

Version

11.0 🔥

Component

entity system

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024