如何使用 Gedmo 的 NestedSet 行为移动树节点

发布于 2024-12-21 23:48:55 字数 359 浏览 1 评论 0原文

我正在使用 Doctrine 2 和 NestedSet 扩展。 在原则 1 中,您可以使用函数 moveAsPrevSiblingOfmoveAsNextSiblingOfmoveAsLastChildOf 来移动节点。

在嵌套扩展的文档中,仅解释了移动同一父级中的节点。没有提及将一个节点移动到另一个节点。这怎么能做到呢?

是否有原则 1 中的易于使用的功能可用?

i'm using Doctrine 2 and the NestedSet extension.
In Doctrine 1 you had the functions moveAsPrevSiblingOf, moveAsNextSiblingOf and moveAsLastChildOf To move nodes around.

In the documentation of the nested extension only moving a node within the same parent is explained. Move a node to another node is not mention. How can this be done?

Are there easy to use functions as found in Doctrine 1 available?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鹿港巷口少年归 2024-12-28 23:48:55

文档中提供了有关如何移动节点的示例。

$treeRepository
    ->persistAsFirstChild($food)
    ->persistAsFirstChildOf($fruits, $food)
    ->persistAsLastChildOf($vegitables, $food)
    ->persistAsNextSiblingOf($carrots, $fruits);

In the documentation there are examples on how to move the nodes.

$treeRepository
    ->persistAsFirstChild($food)
    ->persistAsFirstChildOf($fruits, $food)
    ->persistAsLastChildOf($vegitables, $food)
    ->persistAsNextSiblingOf($carrots, $fruits);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文