Injecting the Doctrine Entity Manager in services - Bad practice?

Viewed 1067

Using https://insight.sensiolabs.com to scan / check my code, I get the following warning:

The Doctrine Entity Manager should not be passed as an argument.

Why is it such a bad practice to inject the Entity Manager in a service? What is a solution?

2 Answers
Related