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

Make it easier to 'tag' a Repo to a ContentType #19

Open
gggeek opened this issue Mar 30, 2020 · 0 comments
Open

Make it easier to 'tag' a Repo to a ContentType #19

gggeek opened this issue Mar 30, 2020 · 0 comments

Comments

@gggeek
Copy link
Contributor

gggeek commented Mar 30, 2020

At the moment, when a Wrapper Repo is defined as a service, its definition often looks like this:

    my_site.repository.footer_link:
        class: My\SiteBundle\Repository\FooterLink
        parent: ezobject_wrapper.repository.abstract
        arguments:
            - '@ezpublish.api.repository'
            - '@ezobject_wrapper.entity_manager'
            - []
            - 'footer_link'
            - '@router'
        tags:
            -  { name: ezobject_wrapper.repository, content_type: footer_link }

We need to specify the footer_link ContentType twice:

  • once (jn the tag) for the EntityManager to appropriately be able to associate it with the CT
  • once (as argument for the constructor) for the case that the Repo is used as a service, ie. injected somewhere without going through the EM

As we don't want to make the latter usage unsupported, could we find a smarter way for the EM to be able to associate the service to the CT without having to specify it again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant