title: Doctrine: Creating schema (Unknown Entity namespace alias 'C'.)
body: <p>I am very new to ORM and Doctrine so please be patient with me.</p>
  
  <p>I am more or less following the getting started tutorial now (just with different tables to make it more interesting). I have created two YAML files defining my schema which is very simple:</p>
  
  <p>User:</p>
  
  <pre><code>User:
    type: entity
    table: users
    id:
      id:
        type: integer
        generator: AUTO
    fields:
      firstName:
        type: string
      lastName:
        type: string
      birthdate:
        type: datetime
      email:
        type: string
      username:
        type: string
      password:
        type: string
    oneToMany:
      pages:
        targetEntity: Page
        mappedBy: user
  </code></pre>
  
  <p>Page:</p>
  
  <pre><code>Page:
    type: entity
    table: pages
    id:
      id:
        type: integer
        generator:
          strategy: AUTO
    fields:
      name:
        type: string
      content:
        type: text
    manyToOne:
      user:
        targetEntity: User
        inversedBy: pages
  </code></pre>
  
  <p>Now I am trying to use the SchemaTool to create a database schema. When I run this code:</p>
  
  <pre><code>$em = Zend_Registry::get('entityManager');
  $tool = new \Doctrine\ORM\Tools\SchemaTool($em);
  $classes = array(
      $em-&gt;getClassMetadata('Entities\User'),
      $em-&gt;getClassMetadata('Entities\Page')
  );
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>#0 C:\inetpub\wwwroot\zend\library\Doctrine\ORM\Configuration.php(150):
  Doctrine\ORM\ORMException::unknownEntityNamespace('C')
  #1
  C:\inetpub\wwwroot\zend\library\Doctrine\ORM\Mapping\ClassMetadataFactory.php(155):
  Doctrine\ORM\Configuration-&gt;getEntityNamespace('C')
  #2 C:\inetpub\wwwroot\zend\library\Doctrine\ORM\EntityManager.php(247):
  Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;getMetadataFor('C:\inetpub\wwwr...')
  #3
  C:\inetpub\wwwroot\zend\application\modules\default\controllers\DoctrineUtilController.php(16):
  Doctrine\ORM\EntityManager-&gt;getClassMetadata('C:\inetpub\wwwr...')
  #4 C:\inetpub\wwwroot\zend\library\Zend\Controller\Action.php(513):
  DoctrineUtilController-&gt;generateModelsAction()
  #5 C:\inetpub\wwwroot\zend\library\Zend\Controller\Dispatcher\Standard.php(295):
  Zend_Controller_Action-&gt;dispatch('generateModelsA...')
  #6 C:\inetpub\wwwroot\zend\library\Zend\Controller\Front.php(954):
  Zend_Controller_Dispatcher_Standard-&gt;dispatch(Object(Zend_Controller_Request_Http),
  Object(Zend_Controller_Response_Http))
  #7 C:\inetpub\wwwroot\zend\application\Bootstrap.php(177):
  Zend_Controller_Front-&gt;dispatch()
  #8 C:\inetpub\wwwroot\zend\library\Zend\Application.php(366):
  Bootstrap-&gt;run()
  #9 C:\inetpub\wwwroot\zend\public\index.php(54): Zend_Application-&gt;run()
  #10 {main}    
      $tool-&gt;createSchema($classes);
  </code></pre>
  
  <p>Any ideas where could be a problem?</p>
  
  <hr>
  
  <p>Additional information just in case. This is how I create entity manager in the Bootstrap.php file:</p>
  
  <pre><code>protected function _initDoctrine() {
      // (1)
      $config = new \Doctrine\ORM\Configuration();
  
      // Proxy Configuration (2)
      $config-&gt;setProxyDir(APPLICATION_PATH.'/proxies');
      $config-&gt;setProxyNamespace('Application\Proxies');
      $config-&gt;setAutoGenerateProxyClasses(('development' === APPLICATION_ENVIRONMENT));
  
      // Mapping Configuration (3)
      $driverImpl = new Doctrine\ORM\Mapping\Driver\XmlDriver(APPLICATION_PATH.'/configs/mappings/yml');
      $config-&gt;setMetadataDriverImpl($driverImpl);
  
      // Caching Configuration (4)
      if ('development' === APPLICATION_ENVIRONMENT) {
          $cache = new \Doctrine\Common\Cache\ArrayCache();
      } else {
          $cache = new \Doctrine\Common\Cache\ApcCache();
      }
      $config-&gt;setMetadataCacheImpl($cache);
      $config-&gt;setQueryCacheImpl($cache);
  
      // database configuration parameters (5)
      $conn = array(
          'driver' =&gt; $this-&gt;configuration-&gt;database-&gt;adapter,
          'user' =&gt; $this-&gt;configuration-&gt;database-&gt;username,
          'password' =&gt; $this-&gt;configuration-&gt;database-&gt;password,
          'dbname' =&gt; $this-&gt;configuration-&gt;database-&gt;dbname
      );
  
      // obtaining the entity manager (6)
      $evm = new Doctrine\Common\EventManager();
      $this-&gt;entityManager = \Doctrine\ORM\EntityManager::create($conn, $config, $evm);
      Zend_Registry::set('entityManager', $this-&gt;entityManager);
  }
  </code></pre>