Closed
Description
The data transformer cookbook is configuring the entity maanegr by passing it through an option. This is a bad practice. Dependencies should be injected in the type through the constructor. Otherwise, all parent fields would need to know the EM too to pass it.
To allow switching between managers, the clean way is to allow passing its name (which is a string, not an object) and getting it from the registry. See the DoctrineType for instance.