Doctrine中使用DQL访问多对多中间表中的字段
我有一个名为 ContentGroup 的模型和另一个名为 Content 的模型,它们之间具有多对多关系。
中间表有一个名为“位置”的字段,当我尝试编写 DQL 查询来获取与 ContentGroup 关联的所有内容时,我无法使用所涉及的模型或关系的别名来引用位置字段。
有人试试这个吗?
谢谢!
i have a model called ContentGroup and another called Content with a many-to-many relation between them.
The intermediate table has a field called Position, When i try to write a DQL query to obtain all the contents associated with a ContentGroup i cannot reference the position field usign the aliases of the models or relations involved.
someone try this?
thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
考虑中间模型
IntModel
。没有测试过,但这应该有效:
Consider intermediate model
IntModel
.Didn't tested, but this should work: