如何使用 yaml 在学说 2 中建模继承? [英] how to model inheritance in doctrine2 with yaml?
问题描述
如何通过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屋!