prestaconcept / PrestaSitemapBundle

A symfony bundle that provides tools to build a rich application sitemap. The main goals are : simple, no databases, various namespace (eg. google image), respect constraints etc.
MIT License
347 stars 100 forks source link

Repository service id ? #297

Closed juvabien closed 2 years ago

juvabien commented 2 years ago

Hello,

Could you please documente this option : "@<your repository service id>" in services.yaml?

I don't know what value I should put. An example would be perfect

Thank you

yann-eugone commented 2 years ago

Symfony is using a dependency injection container, in that container every "service" as an id. https://symfony.com/doc/current/service_container.html

You should replace this value with the id of the service representing your repository.

But as said in documentation, if you are using service discovery (this is the default behavior in Symfony), then you are not required to configure the listener manually, because Symfony will create the service for you and autowire its constructor arguments for you too. https://symfony.com/doc/current/service_container/autowiring.html