【发布时间】:2015-05-23 15:28:25
【问题描述】:
使用 symfony2 和教义树扩展的教义2,我最近更新了一个实体,使其成为教义嵌套集树。
一个原则架构更新强制添加了带有空数据的右列。
然后我运行以下代码:
$repo = $this->getDoctrine()->getRepository('AppBundle:FoodAnalytics\Recipe');
$repo->verify();
// can return TRUE if tree is valid, or array of errors found on tree
$repo->recover();
$this->flush(); // important: flush recovered nodes
// if tree has errors it will try to fix all tree
它成功恢复了左右和水平值,但没有恢复根。 我不能手动设置根值(被教义监听器禁止)。
如何更新这些根值以便树可以正常工作?
谢谢!
【问题讨论】:
标签: php symfony doctrine-orm tree nested