Map sql view to php doctrine2

I have a view in my database created using

CREATE VIEW TBL_TITLE (...) 

This view is described in yaml

 HQ\Title: type: entity table: TBL_TITLE fields: (...) lifecycleCallbacks: { } 

This works great: my objects load and write correctly. But when I run orm:schema-tool:update , I get

 CREATE TABLE TBL_TITLE (...); 

So doctrine2 (2.1.6) does not see that TBL_TITLE already exists as a view and wants to create a table. How to declare TBL_TITLE as a view so that it can be recognized?

+4
source share
1 answer

You cannot, the schema tool will not be able to handle this in its current state.

+5
source

Source: https://habr.com/ru/post/1432692/


All Articles