Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of the ContentRichEntityInterface #183

Open
alexander-schranz opened this issue Jan 18, 2021 · 0 comments
Open

Get rid of the ContentRichEntityInterface #183

alexander-schranz opened this issue Jan 18, 2021 · 0 comments
Labels
DX Only affecting the end developer Feature New functionality not yet included in Bundle

Comments

@alexander-schranz
Copy link
Member

alexander-schranz commented Jan 18, 2021

The ContentRichEntityInterface has a big disadvantage that we can not add Content to a third party Entity or a Object not in our Context. And I personally think it should be possible to add Content to every Doctrine Entity, also if it comes from a third party bundle where we are not able to add an Interface to it.

As written in the Rename ContentRichEntity to Resource Issue.

Currently the ContentRichEntityInterface has the following methods:

  • getId()
  • getDimensionContents()
  • createDimensionContent()
  • addDimensionContent(DimensionContentInterface $dimensionContent)
  • removeDimensionContent(DimensionContentInterface $dimensionContent):

And the DimensionContentInterface reference to it with the following methods:

  • getResource()
  • getResourceKey()
  • getResourceId (RoutableInterface)

So we could replace the exist function:

  • getId() -> getResourceId()
  • getDimensionContents() -> DimensionContentRepository should be used here
  • createDimensionContent() -> DimensionContentInterface::create function given the resource object create(object $resource)
  • addDimensionContent(DimensionContentInterface $dimensionContent) -> not needed if a relation on doctrine exist can be called in create could call the add on the resource
  • removeDimensionContent(DimensionContentInterface $dimensionContent): -> never used or called by us
@alexander-schranz alexander-schranz added DX Only affecting the end developer Feature New functionality not yet included in Bundle labels Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Only affecting the end developer Feature New functionality not yet included in Bundle
Projects
None yet
Development

No branches or pull requests

1 participant