title: Symfony2/Doctrine2: Generate entities that are outside a bundle
body: <p>I'm trying to generate entities for my Symfony 2application. The entities will be shared by several bundles (and maybe several applications), and thus I do not want them to belong to a bundle.
  I want them to be in the src/MyApp/Entity folder.</p>
  
  <p>I already have the YML for my entities, stored in src/MyApp/Entity/config/doctrine (class1.orm.yml, ...)</p>
  
  <p>I'm trying to generate the corresonding PHP classes using the doctrine:generate:entities task</p>
  
  <p>Here is what I have in my app/config/config.yml</p>
  
  <pre><code>orm:
      auto_generate_proxy_classes: %kernel.debug%
      auto_mapping: false
      mappings: 
        AppRest: 
          type: yml 
          prefix: AppRest\Entity 
          dir: %kernel.root_dir%/../src/AppRest/Entity/config/doctrine
  </code></pre>
  
  <p>Here is the command I use to generate the entities</p>
  
  <pre><code>php app/console doctrine:generate:entities AppRest/Entity
  </code></pre>
  
  <p>Here is the exception I get</p>
  
  <pre><code>[InvalidArgumentException]
  Bundle "AppRest" does not exist or it is not enabled.
  </code></pre>
  
  <p>I want to make doctrine understand that I'm not trying to generate entities tha are in a bundle. I also tried specifying the --path option (--path=src/AppRest/Entity), but it did not change anything.</p>
  
  <p>Can anyone help ?</p>
  
  <p><strong>Edit</strong>: </p>
  
  <p>I removed the extra space in my dir, which solved the problem. The path option <strong>must</strong> be specified</p>