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:
| src
|----User
|--------Domain
|------------Entity
|----------------User.php
|--------Infrastructure
|------------Resources
|----------------config
|--------------------doctrine
|-------------------------User.orm.yml
My doctrine config file, looks like this one:
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
And the User.orm.yml
mapping file:
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
When I try to migrate schema by typing: bin/console doctrine:schema:update --force
.
Leads to the message:
[OK] No Metadata Classes to process.
Am I doing wrong for this?
Thanks!