I have an working application. Now I want to change the table names of my entities from CamelCase to underscore_case.
Old code:
/**
* @ORM\Table(name="FeaturedProduct")
*/
class FeaturedProduct
{ ... }
every thing works
New code:
/**
* @ORM\Table(name="featured_product")
*/
class FeaturedProduct
{ ... }
Now I get:
An exception has been thrown during the rendering of a template:
(“SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘myapp.FeaturedProduct’ doesn’t exist”) in MyApp::layout_user_2_col.html.twig at line 37.
MyApp/Resources/views/layout_user_2_col.html.twig:37
{% render "MyApp:FeaturedProduct:random" %}
The file MyApp/Resources/views/FeaturedProduct/random.html.twig exists.
It looks like twig is using the table name for the path of the templates instead of the name of the controller.
I have found the error.
I used the name of the table in a native doctrine query in my FeaturedProduct repository. Changing this to take the table name dynamic solved the problem.