symfony - Use commands to generate different corresponding entities in different bundles according to the database in a project
世界只因有你
世界只因有你 2017-05-16 16:45:06
0
1
391

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.

世界只因有你
世界只因有你

reply all(1)
滿天的星座

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-backup
Like this doctrine will load only the entity you need. Just be carefull on the filter you must use the CamelCase.
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template