Symfony2,Doctrine2,MySql,查看表 [英] Symfony2, Doctrine2, MySql, view tables

查看:155
本文介绍了Symfony2,Doctrine2,MySql,查看表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简单的问题是,是否支持doctrine2中的视图表?我发现它可以'读'当前的模式 http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/schema-manager.html 但是它能创建新的视图表,如其他实体? / p>

它可以解决很多问题。

解决方案

在mapper中定义视图我认为你不能这样做
如果你只想使用视图来读取数据,我想你可以这样做。只需在mapper中定义视图字段,就像一般表


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

这篇关于Symfony2,Doctrine2,MySql,查看表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆