Revision support is currently stuffed in the main entity load controller, but there are a couple of different code paths there so it is a lot of checking if ($revision). There's also no support for multiple load or static caching of revisions - since mixing that in with the main load methods would be a real pain and overcomplicated.

So I'd suggest doing the following:

- remove the load() function from the base entity interface.
- add an EntityLoadController interface and rename DrupalDefaultEntityController to EntityLoad
- add an EntityLoadRevision class, should be possible to extend EntityLoad and override a couple of methods
- remove revision support from the main load controller and the factories.

Comments

jelle_s’s picture

If this is added to D8 *all* entities should be able to have revisions (I think). Currently users don't have revisions. There's an issue about that too:
#540118: Add revision support to users

berdir’s picture

Status: Active » Closed (duplicate)

The function is added in #1184272: Remove deprecated $conditions support from entity controller but with just an additional method rather additional interfaces. The suggestion here doesn't make much sense to me, we can't remove the revision support for loading the newest revision because we always need to join that table.