Symfony2 Form Events Listener and Data Transformer Error Cannot instantiate interface Doctrine\…\ObjectManager
问题 I'm working on a Symfony 2.3 form which require that a field be only available on "create new" mode. The field is a link in a Many-to-One relationship, i've managed to change the dropdown list by using a jQuery AutoComplete for ease of use via a FormEvents::PRE_SET_DATA event ,however the FormEvents::PRE_SUBMIT which is to turn the ID supplied into an object require a Doctrine ObjectManager. This turn to be an Interface and throw the 'Cannot instantiate interface Doctrine\Common\Persistence