Dependency injection with custom Doctrine 2 data type
问题 I have pretty much an identical issue as Dependency injection with custom Doctrine 2 hydrator, but I need to inject a service into a custom data type , not into a hydrator. The solution in the referenced question is relies on duplicating and modifying doctrine source code as Doctrine initializes the classes itself. Hopefully another approach is viable to custom data types? This is for a Symfony3 application, if there could be some magic to be applied there. 回答1: Per the comments in the