Simple question, is there support for view-tables in doctrine2? I found that it can 'read' current schema http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/schema-manager.html But can it create new view-tables like others entity\tables ?
It can solve a lot of issues.
if you want to define views in mappers I think you can't do this If you want simply use views to read data from them I think you can do it. Simply define views fields in mapper as for general tables
The technique I used is to create an entity based on the view :
Verify the following parameters in the created entity annotations :
/** * @ORM\Table(name="table_name") * @ORM\Entity(repositoryClass="AppBundle\Repository\TableNameRepository") */
Then create a new table with a sql command :
To add a doctrine like primary key to your view, use this statement :
Or you can specify the new table name with Doctrine and create it with a :
followed by a
Then use your entity in the controller, as simple as that.