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”
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