Problem/Motivation
Entity storage controllers require entity information, so they currently have to call entity_get_info(). This is not only bad in terms of dependency injection, but can lead to recursion, if you need to access the storage controller while building the entity info.
(This bit us in #1043198: Convert view modes to ConfigEntity, but in the end we ended up not needing this change.)
Proposed resolution
Pass in the entity info into the storage controllers. Luckily, storage controllers are instantiated exactly once in core (entity_get_controller()) and that already has the entity info at hand.
Remaining tasks
Review and commit the patch.
User interface changes
None.
API changes
None, since the constructor is not part of the interface anymore, here. (We might want to add it back, because in this case, we always pass the same, hardcoded arguments.) For people doing contrib storage controllers, it will be a change, but most of the time, they will need the entity info anyway, so. It's also a BC-compatible change (it *adds* an argument).
Comment | File | Size | Author |
---|---|---|---|
#1 | 1828640-1-entity-storage-info.patch | 3.83 KB | tstoeckler |
Comments
Comment #1
tstoecklerHere we go.
Comment #2
BerdirThat happened :)