Problem/Motivation
In #3021963: Add a way to clear only static cache a new EntityCacheEntityControllerInterface is introduced, allowing to reset only the entity controller's internal static cache, but that method is only available for core entity types, whereas most contrib types relies on the Entity-provided controllers.
Proposed resolution
Implement EntityCacheEntityControllerInterface in a fully backwards-compatible way: add the new ::resetStaticCache() method to EntityAPIController, but provide new classes formally implementing the new interface extending both EntityAPIController and EntityAPIControllerExportable in a file that's loaded only if the new interface is available. This way we don't have to introduce a dependency on the Entity Cache module and its versions.
Remaining tasks
- Validate the prosed solution
Post a patch- Reviews
User interface changes
None
API changes
Only additions
Data model changes
None
Release notes snippet
A new method is available for entity cache-aware controllers to reset only static cache.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | entity-static_cache_reset-3021974-4.patch | 2.38 KB | plach |
Comments
Comment #2
plachComment #3
catchVery minor nit but 7.x code standards still ask for an @file here I think.
Should this cross-reference back to the methods / explain why the classes are empty? More or less duplicating the comment in the other file but would be more explanatory for people finding this file first.
Comment #4
plachFixed, thanks!
Comment #5
catchLooks good to me now. I just committed the entitycache end of this (although the way this is written there's no strict dependency on it having landed or being in a tagged release etc.).