Re: Convert simple threaded to a tree
Do not forget the parent_id
Also, what do you mean with existing data?
Am Mittwoch, 7. August 2013 17:03:25 UTC+2 schrieb Mohammad Naghavi:
-- By default it would all be just a flat list (none of them would have a parent).
This is also a valid tree
How would you be able to tell which is the parent of which?
If it can be automated, there is an easy way to do that with Cake.
But first, you need to find out how it can be automated. Otherwise you need to manually
edit each record.
Am Mittwoch, 7. August 2013 17:03:25 UTC+2 schrieb Mohammad Naghavi:
Hi all,this is straight forward, I have a bid table, which used parent_id to make a threaded hierarchy. now after a time that the application is used, I'm facing problems that can be done perfectly using tree behavior. I have added the lft and rght columns but can find an easy way to convert existing data into a tree behavior compatible form.the last way is to make a temporary table, read from current and write into new, and later swap old with new and remove the old, but I have too much data in the table that it may not be possible at least at once.do you have any idea how to do it easier? It can be done also directly in DB (mysql).
Thanks in advance for any suggestion.Mohammad
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home