Answer the question
In order to leave comments, you need to log in
How to pass an entity to a Symfony2 service and should it be done?
Please tell me, is it correct to transfer the entity itself to the service through the container service config, instead of the entity manager, with the subsequent receipt of the entity? If yes, how to implement it?
Answer the question
In order to leave comments, you need to log in
You will hardly find more and better than in the Symfony documentation... perhaps you will find the answer to your question on how to implement it in one of the links.
symfony.com/doc/current/book/service_container.html
symfony.com/doc/current/components/dependency_inje...
Perhaps this is the answer to the question of whether it is correct. I recommend to the questions "Is it right ..." to refer to the section Best Practices from the documentation. It is often useful to dig there.
symfony.com/doc/current/best_practices/business-lo...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question