Skip to content

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

Description

@gggeek

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions