M4kn4sh
M4kn4sh

Reputation: 550

Symfony Entites import - No Metadata Classes to process

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

  1. Create a bundle in src/ :

    <?php
    namespace App;
    
    use Symfony\Component\HttpKernel\Bundle\Bundle;
    
    class App extends Bundle
    {
    }
    
  2. In config/bundles.php, add :

    App\App::class => ['all' => true],
    
  3. Execute php bin/console doctrine:mapping:import --force App xml to generate *.orm.xml files

  4. 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

Answers (2)

flik
flik

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

M4kn4sh
M4kn4sh

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

Related Questions