title: ZF2 with Doctrine 2 - Injecting dependencies in entities
body: <p>I am using Doctrine 2 in a Zend Framework 2 application. Is there any way using ZF2 to inject dependencies into entities returned by Doctrine? Entities are constructed by Doctrine when retrieved from the database. So far as I know to inject dependencies in ZF2 I need to instantiate entities using Service Locator. I cannot see how I can integrate that with Doctrine without having to modify Doctrines code base. The only feasible solution I can see right now is to write a small service which takes the result returned from Doctrine and injects the required dependencies. Is there a more elegant solution?</p>
  
  <p>Best Regards 
  Christian   </p>