有关 Doctrine ORM 的 YAML 映射的完整文档?

发布于 2024-10-08 21:00:15 字数 214 浏览 0 评论 0原文

实体的 YAML 映射文档 似乎缺乏。它没有解释什么是不同的类型、不同的生成器策略、mappedBy 的含义、允许什么类型的级联值、如何定义多对一关系等等。在哪里可以找到此 YAML 文件的完整文档?

The YAML mapping documentation for entities seems to be lacking. It doesn't explain what the different types, the different generator strategies, what mappedBy means, what types of cascade values are allowed, how to define a many-to-one relationship, and a whole lot more. Where can I find full documentation for this YAML file?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

空城旧梦 2024-10-15 21:00:15

不幸的是,目前原则 2 的 yaml 格式文档非常有限。

目前,了解 yaml 格式的最佳方法是查看 yaml 驱动程序实现。

Doctrine\ORM\Mapping\Driver\YamlDriver

通读 loadMetadataForClass 方法的实现。这会向您显示驱动程序在哪里期望什么属性。

您还可以查看注释文档来补充您的理解。许多记录的字段名称和期望值与 yaml 格式相同。例如:一旦您确定 @column 对应于 yaml 格式的 fields 元素,该元素的其余注释文档就与 yaml 格式一致。

Unfortunately, the yaml format documentation for doctrine 2 is pretty limited at the moment.

Right now, the best way to figure out the yaml format is to look at the yaml driver implemetation.

Doctrine\ORM\Mapping\Driver\YamlDriver

Read through the the implementation of the loadMetadataForClass method. That shows you what properties the driver is expecting where.

You can also look at the annotations documentation to supplement your understanding. Many of the documented field names and expected values are the same as the yaml format. For example: once you figure out @column corresponds to the fields element of the yaml format, the rest of the annotations documentation for that element lines up with the yaml format.

一萌ing 2024-10-15 21:00:15

您可以查看位于Doctrine\Orm\Mapping\ClassMetadataInfo 类,

path/to/doctrine/library/Orm/Mapping/ClassMetadataInfo.php

在该类中您可以找到大部分可能的内容。如果你仔细阅读评论,它会给你一个更好的想法。

You can have look at Doctrine\Orm\Mapping\ClassMetadataInfo class located at

path/to/doctrine/library/Orm/Mapping/ClassMetadataInfo.php

In this class you can find mostly what's possible. If you read the comments carefully it will give you a better idea.

┾廆蒐ゝ 2024-10-15 21:00:15

v1.2 手册更加完整。

The v1.2 manual is much more complete.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文