title: Using the ServiceLocator in ZF2 with Doctrine 2 from/in a Custom Class?
body: <p>i have a little problem using doctrine 2 in Zend Framework 2 i have custome class that i use to manipulate doctrine generated model (basically to inject data and populate), to make that work i need the entity manager which is available through the service manager as indicated in Jason Grimes tutorial here <a href="http://www.jasongrimes.org/2012/01/using-doctrine-2-in-zend-framework-2/" rel="nofollow">http://www.jasongrimes.org/2012/01/using-doctrine-2-in-zend-framework-2/</a>.</p>
  
  <p>In his tutorial it works (i tested it) as the ServiceLocator is called from a controller class, but for the application i am writing i have to use custom (non controller) classes to interact with the entities.  How do i achieve this? Using the servicelocator from a custom class that is not a controller?  Thank you all in advance</p>