2
在我的項目中,我需要使用JMSSerializer更新Doctrine2實體。我的JSON看起來是這樣的:使用JMSSerializer關聯反序列化JSON
{"id":28,"prefixes":[{"id":8},{"id":11},{"id":14}]}
我的實體prefixes
定義爲一個多對多的關聯。我已經在使用Doctrine對象構造函數。
當我嘗試反序列化JSON的,JMSSerializer反序列化prefixes
爲新的實體,這將導致該錯誤:
A new entity was found through the relationship 'PartKeepr\\UnitBundle\\Entity\\Unit#prefixes' that was not configured to cascade persist operations for entity
上發生了什麼事情上的任何輕?
您是否嘗試過在單元實體模式文件中的關係定義中添加「cascade:persist」? – Warzyw