Scenario
Talk about Symfony2. I have an entity with his setters and getters. One of this setter is a bit particular, because have to retrieve some related object, do something and write back ralationship.
What came in my mind, for retrieve those objects, is to use the entity manager and repository related to my entity.
Problem
I haven't the possibility to access Entity Manager directly from entity. One possible solution is to inject the E.M. into this entity but, as far I know, dependency injection is not recommended for entity.
Possible solution
Write a service, inject into it E.M., use service into entity.
Please pay attention to this: I can't instantiate my entity elsewhere because a Bundle (SonataAdmin) is responsible for doin' that.
Is this a good way to do it, or exists a better method?