Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
We want to have a reliable unified way to represent relationships. That way we can normalize a relationship, generate links and use polymorphism to alter any specific bahavior.
Proposed resolution
#2751985: [FEATURE] Add a bundle level relationship to entity level resources introduces the RelationshipInterface
class. We can refactor the EntityReference based relationships to use the relationship class.
Comment | File | Size | Author |
---|---|---|---|
#12 | 2755025--interdiff--7-11.txt | 556 bytes | e0ipso |
#12 | 2755025--refactor-relationship--11.patch | 92.88 KB | e0ipso |
Comments
Comment #2
e0ipsoStarting to work on this. This depends on #2751985: [FEATURE] Add a bundle level relationship to entity level resources.
Comment #3
e0ipsoComment #4
e0ipsoWe can merge this whenever we get a resolution on #2751985: [FEATURE] Add a bundle level relationship to entity level resources if the tests come back green.
Comment #5
e0ipsoAfter it was decided in #2751985: [FEATURE] Add a bundle level relationship to entity level resources that we would drop support for the entity-level resources, I will refactor this patch to not include that code.
Comment #6
e0ipsoWork test bot! Work!
Comment #7
dawehnerThis patch looks really great! Freedom for relationships!
Here is an interface which addresses some points. IMHO Its semantically wrong to let ConfigEntityNormalizer extend ContentEntityNormalizer, but this is of course easy to change.
While going through the files I fixed a bunch of unused use statements.
Comment #12
e0ipsoComment #13
e0ipsoComment #14
e0ipsoMerging b/c green.
Comment #16
dawehnerOh I'm sorry for my stupidity!
Comment #17
e0ipso… right …
…
xD