title: creating mapped ORM Entities without the cli?
body: <p>I'm working on an apiglity project that uses zend framework 2 and the doctrine.</p>
  
  <p>i included in local.config.php of my zf2 project the following code:</p>
  
  <pre><code>return array(
   'doctrine' =&gt; array(
      'connection' =&gt; array(
          'orm_default' =&gt; array(
              'driverClass' =&gt; 'Doctrine\DBAL\Driver\PDOMySql\Driver',
              'params' =&gt; array(
                  'host'     =&gt; 'localhost',
                  'port'     =&gt; '3306',
                  'user'     =&gt; '&lt;username&gt;',
                  'password' =&gt; '&lt;password&gt;',
                  'dbname'   =&gt; '&lt;db&gt;',
              )
          )
      )
  ),
  );
  </code></pre>
  
  <p>in my main module's configuration file (module.config.php) I included the following code:</p>
  
  <pre><code> 'doctrine' =&gt; array(
      'driver' =&gt; array(
          __NAMESPACE__ . '_driver' =&gt; array(
              'class' =&gt; 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
              'cache' =&gt; 'array',
              'paths' =&gt; array(__DIR__ . '/../src/' . __NAMESPACE__ . '/Entity')
          ),
          'orm_default' =&gt; array(
              'drivers' =&gt; array(
                  __NAMESPACE__ . '\Entity' =&gt; __NAMESPACE__ . '_driver'
              )
          )
      )
  )
  </code></pre>
  
  <p>I read the following URL:
  <a href="http://samsonasik.wordpress.com/2013/04/10/zend-framework-2-generate-doctrine-entities-from-existing-database-using-doctrinemodule-and-doctrineormmodule/" rel="nofollow noreferrer">http://samsonasik.wordpress.com/2013/04/10/zend-framework-2-generate-doctrine-entities-from-existing-database-using-doctrinemodule-and-doctrineormmodule/</a></p>
  
  <p>and it says that to create Entities from my Database I need to use <code>vendor/bin/doctrine-module</code>. </p>
  
  <p>When I try to execute doctrine-module I get the following error:</p>
  
  <pre><code>PHP Fatal error:  Uncaught exception 'Zend\ServiceManager\Exception\ServiceNotFoundException' with message 'Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for doctrine.cli' in /mnt/storage/home/ufk/projects/myalcoholist-apigility/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:529
  Stack trace:
  #0 /mnt/storage/home/ufk/projects/myalcoholist-apigility/vendor/doctrine/doctrine-module/bin/doctrine-module.php(51): Zend\ServiceManager\ServiceManager-&gt;get('doctrine.cli')
  #1 /mnt/storage/home/ufk/projects/myalcoholist-apigility/vendor/doctrine/doctrine-module/bin/doctrine-module(4): include('/mnt/storage/ho...')
  #2 {main}
  thrown in /mnt/storage/home/ufk/projects/myalcoholist-apigility/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 529
  
  Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\ServiceNotFoundException' with message 'Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for doctrine.cli' in /mnt/storage/home/ufk/projects/myalcoholist-apigility/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:529
  Stack trace:
  #0 /mnt/storage/home/ufk/projects/myalcoholist-apigility/vendor/doctrine/doctrine-module/bin/doctrine-module.php(51): Zend\ServiceManager\ServiceManager-&gt;get('doctrine.cli')
  #1 /mnt/storage/home/ufk/projects/myalcoholist-apigility/vendor/doctrine/doctrine-module/bin/doctrine-module(4): include('/mnt/storage/ho...')
  #2 {main}
  thrown in /mnt/storage/home/ufk/projects/myalcoholist-apigility/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 529
  </code></pre>
  
  <p>by reading the following stack overflow question:
  <a href="https://stackoverflow.com/questions/26128660/apigility-how-to-use-doctrine-orm-module-from-zf2-command-line">Apigility - How to use Doctrine ORM Module from ZF2 command line</a></p>
  
  <p>I understood that the doctrine-module client is not necessary and I should execute</p>
  
  <pre><code>php public/index.php orm:info
  </code></pre>
  
  <p>in order to see the status of doctrine. </p>
  
  <p>when executing this I get the following error message:</p>
  
  <pre><code>[Exception]                                                                                                       
  You do not have any mapped Doctrine ORM entities according to the current configuration. If you have entities or  
  mapping files you should check your mapping configuration for errors.                                            
  </code></pre>
  
  <p>this is because I created the Entities folder and it's empty.</p>
  
  <p>now the question is, how do I create Entities based on database if I can't use the doctrine-module ?</p>