A
A
Argumentus2018-08-09 12:34:54
symfony
Argumentus, 2018-08-09 12:34:54

How to map views from a database?

Good afternoon.
I'm trying to create an entity from tables and views from mssql, I execute the
php bin/console doctrine:mapping:convert annotation ./src/Entity --from-database --em="myem" command,
after which table entities are created, but not views. What am I doing wrong and how can I create entities from views?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Skobkin, 2018-08-09
@skobkin

As the Doctrine tools documentation says, reverse engineering is a one-time process to get started on a project. Doctrine is able to convert approximately 70-80% of the necessary mapping information based on fields, indexes and foreign key constraints. Doctrine can't discover inverse associations, inheritance types, entities with foreign keys as primary keys or semantical operations on associations such as cascade or lifecycle events. Some additional work on the generated entities will be necessary afterwards to design each to fit your domain model specificities.

https://symfony.com/doc/current/doctrine/reverse_e...
Just create the required entities manually.
But check out the rest of the answers from that SO thread. It is better, of course, not to use view with Doctrine.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question