Problem/Motivation
For both #2869792: Add constraints to all config entities and #2300677: [PP-1] Create/Update/Delete (POST/PATCH/DELETE) ConfigEntity via REST it would be helpful to get a typed config respresentation for a given entity.
Currently you'd need to call $typedConfigManager->get($name)
, which is tricky as:
- Getting the name from is different from config and config entity case
- It doesn't actually work for config entities, which haven't been saved yet
Possible solutions:
- Add a
->typedData()
method to both ConfigBase and ConfigEntityBase - Add methods to TypedConfigManager to return what is needed
Proposed resolution
For now I went with the second solution as I'd like to separate the idea of typed data from runtime representations of configuration.