Introduce an object to hold config dependency data

Created on 24 February 2023, over 1 year ago

Problem/Motivation

Config dependency arrays are complex: they contain 2 levels, keyed first by type and then containing items. The format of each item is different depending on the type.

These arrays need to be merged sometimes, and passed around.

For example, if a permission depends on a config entity, you need to get the dependency array from the config entity, possibly merge it with other dependencies, and then set it on the permission definition.

Steps to reproduce

Proposed resolution

Introduce a class to hold this data, which allows merging. This would work in a similar way to CacheableMetadata.

E.g.

$dependencies = new DependencyMetadata()l
$dependencies
  ->addModuleDependencies('mymodule')
  ->merge($plugin->getDependencies())

For BC, this object would need to implement ArrayAccess.

Remaining tasks

- Decide how to implement this
- Bikeshed the class name
- Decide whether to wait for πŸ“Œ Create \Drupal\Component\Utility\ArrayObject Needs work to get in

User interface changes

API changes

New class.

Data model changes

Release notes snippet

✨ Feature request
Status

Active

Version

10.1 ✨

Component
ConfigurationΒ  β†’

Last updated 1 day ago

Created by

πŸ‡¬πŸ‡§United Kingdom joachim

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

Comments & Activities

Production build 0.71.5 2024