Reputation: 550
With Symfony 4, I want to generate Entities from an existing database but when I try to convert my *.orm.xml
files, I get this message :
[OK] No Metadata Classes to process.
I have several *orm.xml
files in src/Resources/config/doctrine
:
ls -l src/Resources/config/doctrine/
Steps to reproduce
Create a bundle in src/
:
<?php
namespace App;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class App extends Bundle
{
}
In config/bundles.php
, add :
App\App::class => ['all' => true],
Execute php bin/console doctrine:mapping:import --force App xml
to generate *.orm.xml
files
Execute php bin/console doctrine:mapping:convert annotation ./src
to generate entities.
The last command return the message No Metadata Classes to process.
.
https://symfony.com/doc/current/doctrine/reverse_engineering.html
Any idea ?
Many thanks
Upvotes: 0
Views: 1418
Reputation: 3633
This problem comes when you have something wrong in your YML / XML / Entity mapping files. Possible reason paths or names are wrong.
Upvotes: 0
Reputation: 550
I think I didn't understand the official documentation...
I remove the content of src/Resources/config/doctrine
and I execute this command and my entities are generated :
php bin/console doctrine:mapping:import --force App annotation
The php bin/console doctrine:mapping:convert annotation ./src
is not useful in this case...
What I understood I generate metadata files with :
php bin/console doctrine:mapping:import --force App xml
After, I can convert these *.orm.xml
files with
php bin/console doctrine:mapping:convert annotation ./src
But this is not working :( I don't understand why...
But, if I do not do anything of that (don't generate metadata), and I'm doing this instead :
php bin/console doctrine:mapping:import --force App annotation
This is working...
Upvotes: 1