Hi grigri,

thanks for your feedback.

I get what you're saying, but is it just me or does it seem "wrong" to
corrupt the tree, even though we fix it again (re-sync it)?

On Jun 5, 5:09 pm, grigri <[EMAIL PROTECTED]> wrote:
> > Then the children will not get deleted and I'll end up with orphans..
>
> Really? I admit I don't use the TreeBehavior, but I am familiar with
> MPTT hierarchies, and I've got the code in front of me.
>
> I might well be wrong, but it seems like this:
>
> With the above code:
>
> 1. You call Asset::del(<id>), maps to Model::del();
> 2. Upload::beforeDelete() is called, file is deleted (<id>)
> 3. Tree::beforeDelete() is called with <id>, Tree:deleteAll() is
> called (once) for all descendants of <id> (not just direct children)
> 4. Tree::deleteAll() detaches Tree behavior
> 5. Tree::deleteAll() calls Model::deleteAll() with cascade and
> callbacks
> 6. Model::deleteAll() performs a find('all') - retrieving the ids of
> all the descendants, calls Asset::del() on each descendant (maps to
> Model::del())
> 7. [each descendant] Model::del() calls Asset::beforeDelete, file is
> deleted
>     (Tree::beforeDelete() is not called because it's still detached)
> 8. Tree::deleteAll() re-attaches Tree behavior and exits
> 9. Upload::beforeDelete re-syncs the tree
> 10. rest of Asset::del(<id>)
>
> I could be completely wrong here, but looking at the code it seems to
> me this is how it would play out.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to