单表继承和Yaml配置
我想在我的项目中使用 symfony2/doctrine 的单表继承,但我找不到任何带有 yaml 配置的工作示例。官方文档中仅提供了注释配置。我找到了 xml 示例,但我想使用 yaml 配置。有人可以帮助并分享一些工作代码吗?
I want to use in my project Single Table Inheritance for symfony2/doctrine, but I can't find any working examples with yaml configuration for it. In official documentation there is only annotation configuration presented. I found xml examples, but I want to use yaml configuration. Can somebody help and share with some working code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好的内置转换器可以挽救生命。
为了节省时间,将继承转换为 yaml 的示例:
Okay built-in converter saves life.
In order to save time this an example of inheritance converted into yaml :
这是YAML 标记的示例:
实体配置文件应根据放入
src/Acme/StoreBundle/Resources/config/doctrine/.orm.yml
href="http://symfony.com/doc/current/book/doctrine.html" rel="nofollow noreferrer">参考。还可以使用内置转换器:如何在 Doctrine2 中对继承进行建模yaml?
Here is an example of YAML markup:
Entities config files should be put into
src/Acme/StoreBundle/Resources/config/doctrine/<EntityName>.orm.yml
according to reference.Also built-in converter can be used: how to model inheritance in doctrine2 with yaml?