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?
At the moment, when a Wrapper Repo is defined as a service, its definition often looks like this:
We need to specify the
footer_linkContentType twice: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?