title: Zend Framework - Doctrine 2 integration : where to store the EntityManager?
body: <p>I am integrating Zend Framework and Doctrine 2.</p>
  
  <p>The question is, in my controllers and view, in need to access the model. I can do all this through a <strong>single instance of the EntityManager</strong>.</p>
  
  <p><strong>Where do I store this instance ?</strong></p>
  
  <ul>
  <li><code>Zend_Registry</code> ? That's where it is now, it is accessible from everywhere, but not really practical : <code>$em = Zend_Registry::get('EntityManager');</code></li>
  <li>As a controller and view property ? That would be accessible as <code>$this-&gt;em</code>, I like this</li>
  <li>Create a factory class that will return the instance ? <code>$em = My\EntityManager\Factory::getInstance();</code>. Encapsulation is good, but long to type...</li>
  <li>Is the <code>EntityManager</code> a Singleton already ? -> (<em>update</em>) not it is not</li>
  </ul>