title: Not finding models when using Doctrine 2 & Zend Framework
body: <p>I started a new project and wanted to use Doctrine 2 within the Zend Framework (1.11).</p>
  
  <p>I configured everything within the Bootstrap &amp; Config, which seemed to be fine.</p>
  
  <p>Here is my first model that I created for use:</p>
  
  <pre><code>&lt;?php
  namespace Entities;
  /**
   * @Entity
   * @Table(name="posts")
   */
  class Post
  {
  
      /** @Id @Column(type="integer") @GeneratedValue */
      public $id;
  
      /** @Column(length=100,nullable=true) */
      public $title;
  
      /** @Column(length=2000) */
      public $message;
  
      /** @Column(type="integer") */
      public $userId;
  
      /** @Column(type="timestamp") */
      public $dateAdded;
  
  }
  </code></pre>
  
  <p>And here is the controller:</p>
  
  <pre><code>&lt;?php
  
  class CityController extends Zend_Controller_Action
  {
  
      public function init()
      {
          /* Initialize action controller here */
      }
  
      public function indexAction()
      {
          $em = Zend_Registry::get('em');
  
          $group = $em-&gt;find('Entities\Post', 1);
      }
  
  
  }
  </code></pre>
  
  <p>When I try accessing the <code>Entities\Post</code> model, it just errors out saying that it doesn't exist. I'm sure it's a Zend naming convention problem, but I tried a few different things, and nothing seemed to work.</p>
  
  <p>Any ideas? And I did look through all the Doctrine 2/Zend tutorials I could find and none of them helped much.</p>
  
  <p><strong>* UPDATE *</strong></p>
  
  <p>Here is my Doctrine init in the bootstrap:</p>
  
  <pre><code>public function _initDoctrine() {
      // include and register Doctrine's class loader
      require_once('Doctrine/Common/ClassLoader.php');
      $classLoader = new \Doctrine\Common\ClassLoader(
          'Doctrine',
          APPLICATION_PATH . '/../library/'
      );
      $classLoader-&gt;register();
  
      // create the Doctrine configuration
      $config = new \Doctrine\ORM\Configuration();
  
      // setting the cache ( to ArrayCache. Take a look at
      // the Doctrine manual for different options ! )
      $cache = new \Doctrine\Common\Cache\ArrayCache;
      $config-&gt;setMetadataCacheImpl($cache);
      $config-&gt;setQueryCacheImpl($cache);
  
      // choosing the driver for our database schema
      // we'll use annotations
      $driver = $config-&gt;newDefaultAnnotationDriver(
          APPLICATION_PATH . '/models'
      );
      $config-&gt;setMetadataDriverImpl($driver);
  
      // set the proxy dir and set some options
      $config-&gt;setProxyDir(APPLICATION_PATH . '/models/Proxies');
      $config-&gt;setAutoGenerateProxyClasses(true);
      $config-&gt;setProxyNamespace('App\Proxies');
  
      // now create the entity manager and use the connection
      // settings we defined in our application.ini
      $connectionSettings = $this-&gt;getOption('doctrine');
      $conn = array(
          'driver'    =&gt; $connectionSettings['conn']['driv'],
          'user'      =&gt; $connectionSettings['conn']['user'],
          'password'  =&gt; $connectionSettings['conn']['pass'],
          'dbname'    =&gt; $connectionSettings['conn']['dbname'],
          'host'      =&gt; $connectionSettings['conn']['host']
      );
      $entityManager = \Doctrine\ORM\EntityManager::create($conn, $config);
  
      // push the entity manager into our registry for later use
      $registry = Zend_Registry::getInstance();
      $registry-&gt;em = $entityManager;
  
      return $entityManager;
  }
  </code></pre>
  
  <p>And here is the config for doctrine (in application.ini):</p>
  
  <pre><code>doctrine.conn.host = 'localhost'
  doctrine.conn.user = '****'
  doctrine.conn.pass = '****'
  doctrine.conn.driv = 'pdo_mysql'
  doctrine.conn.dbname = '****'
  doctrine.path.models = APPLICATION_PATH "/models"
  </code></pre>
  
  <p>As you can see, it's looking for the models in the <code>APPLICATION_PATH "/models"</code></p>