Doctrine2:删除多对多关联的正确方法
我在两个实体之间有多对多关系,我使用 cli 工具从 yaml 配置生成实体,问题是没有方法删除关联。
删除关联的最佳方法是什么?我可以将方法添加到实体中,有更好的方法吗?
I have a many to many relationship between two entities, I am using the cli tool to generate the entities from yaml configs, the problem is that there is no method to delete the associations.
What would be the best way to delete the associations. I can add the method to the entities, is there a better way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在一个应用程序中,我们有一个 User 类,它可以属于一个或多个被映射为多对多关系的类别。
我没有找到从类别中删除用户的绝对干净的方法,但我所做的是:
In one application we had a class User which could be in one or more Categories which was mapped as a many-to-many relation.
I didnt find a absolute clean way to remove a User from a Category, but what I did was: