title: Mapping Entities in Symfony4 using YAML
body: <p>Would like to know what's the best way to map entities in another directory using YAML. I've a tree structre like the one below:</p>
  
  <pre><code>| src
  |----User
  |--------Domain
  |------------Entity
  |----------------User.php
  |--------Infrastructure
  |------------Resources
  |----------------config
  |--------------------doctrine
  |-------------------------User.orm.yml
  </code></pre>
  
  <p>My doctrine config file, looks like this one:</p>
  
  <pre><code>parameters:
      env(DATABASE_URL): ''
  
  doctrine:
      dbal:
          # configure these for your database server
          driver: 'pdo_mysql'
          server_version: '5.7'
          charset: utf8mb4
          default_table_options:
              charset: utf8mb4
              collate: utf8mb4_unicode_ci
          url: '%env(resolve:DATABASE_URL)%'
  
      orm:
          auto_generate_proxy_classes: '%kernel.debug%'
          naming_strategy: doctrine.orm.naming_strategy.underscore
          auto_mapping: true
          mappings:
              User:
                  is_bundle: false
                  type: yml
                  dir: '%kernel.project_dir%/src/User/Infrastructure/Resources/config/doctrine'
                  prefix: 'App\User\Domain\Entity'
                  alias: User
  </code></pre>
  
  <p>And the <code>User.orm.yml</code> mapping file:</p>
  
  <pre><code>App\User\Domain\Entity\User:
      type: entity
      table: users
      repositoryClass: App\User\Infrastructure\Persistance\Doctrine\DoctrineUserRepository
      id:
          id:
              type: integer
              generator:
                  strategy: AUTO
      fields:
          password:
              type: string
              length: 64
              nullable: false
          email:
              type: string
              length: 255
              unique: true
              nullable: false
  </code></pre>
  
  <p>When I try to migrate schema by typing: <code>bin/console doctrine:schema:update --force</code>.
  Leads to the message:</p>
  
  <pre><code>[OK] No Metadata Classes to process.
  </code></pre>
  
  <p>Am I doing wrong for this?</p>
  
  <p>Thanks! </p>