Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3924

Symfony make:entity annotation mapping error

$
0
0

I want to create a new entity in my ORO platform application by using the make:entity command from the MakerBundle.

I expect it to create an entity in my bundle Acme\Bundle\TestBundle which I set in my config_dev.yml by using:

maker:
    root_namespace: 'Acme\Bundle\TestBundle'

So I execute

bin/console make:entity Test

which returns

 ! [NOTE] It looks like your app may be using a namespace other than "Acme\Bundle\TestBundle".                 
 !                                                                                                                      
 !        To configure this and make your life easier, see:                                                             
 !        https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html#configuration                           

 created: src/Acme/Bundle/TestBundle/Entity/Test.php
 created: src/Acme/Bundle/TestBundle/Repository/TestRepository.php


 [ERROR] Only annotation mapping is supported by make:entity, but the                                                   
         <info>Acme\Bundle\TestBundle\Entity\Test</info> class uses a different format. If you would like   
         this command to generate the properties & getter/setter methods, add your mapping configuration, and then      
         re-run this command with the <info>--regenerate</info> flag.                                                   

I've tried to run the command once again, which works. But obviously this is not the way how it's meant to work. So how can I fix this mapping error?


Viewing all articles
Browse latest Browse all 3924


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>