Ask the master: How to ignore the table prefix when generating entities from the database?
For example, t_test directly generates Test when generating entity.
Is there any way to solve this problem? Thanks!
“php bin/console doctrine:mapping:import --force AdminBundle annotation”
習慣沉默2017-05-16 16:45:49
I haven’t found the table prefix configuration in the configuration items. By default t_test
只能生成 entity
Test
.
You can refer to Configuring Prefix Processing or this SQL-Table Prefixes, which adds table prefix service processing.
Simply put:
Modify app/config/services.yml
Then append the file src/AppBundle/Subscriber/TablePrefixSubscriber.php
,其中 AppBundle
and change it to your own path.
The content of the file is
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|