@ManyToMany 与连接表中其他字段的关联
在Symfony2下,如何管理与连接表中附加字段的多对多关联?
例如,我想知道哪个人何时使用马。用户和马具有多对多关联,我们存储该用户骑那匹马的日期。
Under Symfony2, how to manage a Many-to-many association with additional fields in the joining table ?
For instance, I want to know which person uses a horse, and when. User and Horse have a many-to-many association and we store the date when this user rides that horse.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果联接表不仅仅是一个联接表,而且实际上包含其他列,那么您不再拥有 ManyToMany,而是两个 OneToMany 关联:
If the join table is more than just a join table, and in fact contains additional columns, than you don't have a ManyToMany anymore, but two OneToMany associations :