Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ツリー構造リセット時に階層構造を維持したい #3656

Open
seto1 opened this issue Jul 31, 2024 · 1 comment
Open

ツリー構造リセット時に階層構造を維持したい #3656

seto1 opened this issue Jul 31, 2024 · 1 comment
Labels
Adjusting 調整中

Comments

@seto1
Copy link
Collaborator

seto1 commented Jul 31, 2024

TreeBehaviorのrecoverかreorderでいけそうだけどゴミ箱などの考慮は必要

https://book.cakephp.org/2/ja/core-libraries/behaviors/tree.html
https://book.cakephp.org/5/ja/orm/behaviors/tree.html

ツリー構造やリンクされたリストのように、自分自身を参照する複雑なデータ構造は、 その性質上、まれに不用意なコールによって壊れてしまいます。気落ちしないでください。 全てが失われたわけではありません!これまでの文書中には登場していませんが、Tree ビヘイビアはこういった状況に対処するための関数をいくつか持っています。

既存の処理

https://github.com/baserproject/basercms/blob/dev-4/lib/Baser/Model/Content.php
https://github.com/baserproject/basercms/blob/5.1.x/plugins/baser-core/src/Model/Table/ContentsTable.php
resetTree

@ryuring ryuring added the Adjusting 調整中 label Aug 8, 2024
@ryuring
Copy link
Collaborator

ryuring commented Aug 8, 2024

@seto1 Cake2系の時にrecoverかreorderでうまくいかない場合があって、仕方なく今の処理になった経緯があります。
Cake5系では試せてないです。一度確認してもらえますか??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Adjusting 調整中
Projects
None yet
Development

No branches or pull requests

2 participants