In a project, use commands to generate different corresponding entities under different bundles according to the database. database: test table: account,product
There are two bundles in the symfony project
DemoAccountBundle DemoProductBUndle
Use the command directly without considering the corresponding relationship.
php app/console doctrine:mapping:import DemoAccountBundle yml
You can generate everything but it will be under DemoAccountBundle
Is there a way to select generated entities?
The structure is as follows
DemoAccountBundle Entity:Account.php
DemoProductBundle Entity:Product.php
Continuing research, if anyone has implemented it, please let us know.
滿天的星座2017-05-16 16:47:06
You've do this way,
php app/console doctrine:mapping:convert whateveryouwant ./src/App/MyBundle/Resources/config/doctrine --from-database --filter="Yourtablename"Then
php app/console doctrine:mapping:import AppMyBundle whateveryouwant --filter="Yourtablename"And finall
php app/console doctrine:generate:entities AppMyBundle --no-backupLike this doctrine will load only the entity you need. Just be carefull on the filter you must use the CamelCase.