如何使用 yaml 在学说 2 中建模继承? [英] how to model inheritance in doctrine2 with yaml?

查看:23
本文介绍了如何使用 yaml 在学说 2 中建模继承?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过yaml方式声明doctrine2继承?

How to declare doctrine2 inheritance the yaml way?

我在教义文档中找不到任何关于此的代码片段、示例或食谱文章.

I don't find any code snippets, examples or cookbook articles about this in the doctrine documentation.

当我尝试以学说 1 的方式时,我收到一个错误,即实体没有主键.

When i try it the doctrine1 way, i get an error that the Entity has no primary key.

谢谢!

推荐答案

尝试使用 examples(采用@Annotations 格式),并使用带有参数orm:convert 的教义命令行工具将它们转换为yaml-mapping(在支持的格式之间转换映射信息).更多信息这里.

Try doing a simple model inheritance using the examples in the documentation (which are in @Annotations format), and converting them to yaml using the doctrine command line tool with parameters orm:convert-mapping (which converts mapping information between supported formats). More information here.

这篇关于如何使用 yaml 在学说 2 中建模继承?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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