具有 BelongsTo 和 hasOne 关系设置的模型会发生什么情况?

发布于 2024-09-13 15:25:26 字数 109 浏览 1 评论 0原文

当两个模型同时与belongsTo和hasOne关系关联时会发生什么?
框架是否会检测到这种情况以避免检索太多数据?

编辑:特别是 CakePHP,尽管其他框架所做的也会有所帮助。

What happens when two models are associated with a belongsTo and a hasOne relationship at the same time?
Does the framework detect this situation to avoid retrieving too much data?

EDIT: CakePHP specifically, although what other frameworks do would be helpful, too.

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

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

发布评论

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

评论(1

内心荒芜 2024-09-20 15:25:32

大多数框架都会延迟加载数据,即仅在访问对象属性时才检索数据。

Most frameworks do lazy loading of data, that is, data is retrieved only when the object property is accessed.

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