【发布时间】:2012-11-25 12:40:47
【问题描述】:
我想知道如何避免在我的 symfony2.1 应用程序中出现循环引用。 我有一个像
这样的实体customer (
name
addresses -- OneToMany
currentAddress -- OneToOne )
和
address (
street
customer -- ManyToOne )
现在我的装置将无法加载,因为它无法删除客户,因为外键。
为了表现,我想避免必须在客户上添加一个 getCurrentAddress() 方法,该方法将在地址表中进行选择。
有人有解决办法吗?
【问题讨论】:
标签: symfony doctrine circular-reference