Spin-off of #3382559: Deprecate the membership loader in favor of shared bundle classes for merely adding the concept of shared bundle classes.
Right now, Group creates a GroupRelationship bundle every time you install a plugin on a GroupType. This means that, if you were to use regular bundle classes, you'd end up with several classes representing the concept of a group membership, a grouped article or what have you. To improve DX, we want to introduce a concept where one class can be shared among all bundles for a given plugin.
The system will be compatible with regular bundle classes, not interfering with them if they exist. The logic is as follows:
- No shared bundle class, no bundle class: Entity is instance of GroupRelationship
- No shared bundle class, bundle class: Entity is instance of the bundle class
- Shared bundle class, no bundle class: Entity is instance of the shared bundle class
- Shared bundle class, bundle class: Entity is instance of the bundle class
To make it so people can easily create a regular bundle class, you should put all of your shared bundle class functionality in an interface and trait. Then the individual bundle class is not required to extend your shared bundle class, but can easily opt in to your interface by using the trait.
Issue fork group-3382831
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
kristiaanvandeneyndeAdded the code from the other issue, will add tests here.
Comment #5
kristiaanvandeneyndeMerged, now let's move to 2.1.x
Comment #8
kristiaanvandeneyndeComment #9
kristiaanvandeneyndeComment #10
kristiaanvandeneyndeAdded CR